GreatSQL社区

搜索

[已解决] 清理原目录,换目录重装后,进入客户端,报错密码过期

640 4 2024-2-28 11:25
本帖最后由 cse_engineer 于 2024-2-28 15:27 编辑

由于原目录空间不足,尝试换目录/用户重装  原datadir目录已清空

新用户为yxz3  用户组为yxz3(tmpdir 目录位于所属组为yxz3的用户下)

参考: https://greatsql.cn/docs/8032-25 ... centos-install.html

进程启动成功。

找到默认密码, mysql -uroot -p"passwd" 报错:
2024-02-28T10:50:21.029585+08:00 8 [Note] [MY-013851] [Server] Password for the account 'root'@'localhost' has expired. To log in, either change it using a client that supports expired passwords or send the change request to an administrator.

尝试过空密码,失败。

my.cnf 如下

[client]

user = root
socket        = /home/data_raid1/yxz3/data/GreatSQL/mysql.sock

[mysqld]
user        = yxz3
port        = 3306

#主从复制或MGR集群中,server_id记得要不同
#另外,实例启动时会生成 auto.cnf,里面的 server_uuid 值也要不同
#server_uuid的值还可以自己手动指定,只要符合uuid的格式标准就可以
server_id = 3306

basedir = /usr/local/GreatSQL-8.0.32-25-Linux-glibc2.17-x86_64
datadir        = /home/data_raid1/yxz3/data/GreatSQL
socket= /home/data_raid1/yxz3/data/GreatSQL/mysql.sock

pid-file = mysql.pid
character-set-server = UTF8MB4
skip_name_resolve = 1
#若你的MySQL数据库主要运行在境外,请务必根据实际情况调整本参数
default_time_zone = "+8:00"

default_authentication_plugin=mysql_native_password

tmpdir=/home/data_redo/yxz3tmp

#performance setttings
lock_wait_timeout = 3600
open_files_limit    = 65535
back_log = 1024
max_connections = 512
max_connect_errors = 1000000
table_open_cache = 1024
table_definition_cache = 1024
thread_stack = 512K
sort_buffer_size = 40G
join_buffer_size = 40G
read_buffer_size = 40G
read_rnd_buffer_size = 40G
bulk_insert_buffer_size = 64M
thread_cache_size = 768
interactive_timeout = 600
wait_timeout = 600
tmp_table_size = 40G
max_heap_table_size = 40G
max_allowed_packet = 64M
net_buffer_shrink_interval = 180

#GIPK
loose-sql_generate_invisible_primary_key = ON

#log settings
log_timestamps = SYSTEM
log_error = /home/data_raid1/yxz3/data/GreatSQL/error.log
log_error_verbosity = 3
slow_query_log = 1
log_slow_extra = 1
slow_query_log_file = slow.log

#设置slow log文件大小1G及总文件数10
max_slowlog_size = 1073741824
max_slowlog_files = 10
long_query_time = 0.1
log_queries_not_using_indexes = 1
log_throttle_queries_not_using_indexes = 60
min_examined_row_limit = 100
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_bin = binlog
binlog_format = ROW
sync_binlog = 1
binlog_cache_size = 4M
max_binlog_cache_size = 140G
max_binlog_size = 8G

#控制binlog总大小,避免磁盘空间被撑爆
binlog_space_limit = 500G
binlog_rows_query_log_events = 1
binlog_expire_logs_seconds = 604800

#MySQL 8.0.22前,想启用MGR的话,需要设置binlog_checksum=NONE才行
binlog_checksum = CRC32
gtid_mode = ON
enforce_gtid_consistency = TRUE

#myisam settings
key_buffer_size = 32M
myisam_sort_buffer_size = 128M

#replication settings
relay_log_recovery = 1
slave_parallel_type = LOGICAL_CLOCK
#可以设置为逻辑CPU数量的2倍
slave_parallel_workers = 64
binlog_transaction_dependency_tracking = WRITESET
slave_preserve_commit_order = 1
slave_checkpoint_period = 2

#mgr settings
#loose-plugin_load_add = 'mysql_clone.so'
#loose-plugin_load_add = 'group_replication.so'
#loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"

#MGR本地节点IPORT,请自行替换
#loose-group_replication_local_address = "172.16.16.10:33061"

#MGR集群所有节点IPORT,请自行替换
#loose-group_replication_group_seeds = "172.16.16.10:33061,172.16.16.11:33061,172.16.16.12:33061"
#loose-group_replication_start_on_boot = OFF
#loose-group_replication_bootstrap_group = OFF
#loose-group_replication_exit_state_action = READ_ONLY
#loose-group_replication_flow_control_mode = "DISABLED"
#loose-group_replication_single_primary_mode = ON
#loose-group_replication_majority_after_mode = ON
#loose-group_replication_communication_max_message_size = 10M
#loose-group_replication_arbitrator = 0
#loose-group_replication_single_primary_fast_mode = 1
#loose-group_replication_request_time_threshold = 100
#loose-group_replication_primary_election_mode = GTID_FIRST
#loose-group_replication_unreachable_majority_timeout = 0
#loose-group_replication_member_expel_timeout = 5
#loose-group_replication_autorejoin_tries = 288
#report_host = "172.16.16.10"

#innodb settings
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 8
innodb_data_file_path = ibdata1:12M:autoextend
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 32M
innodb_log_file_size = 2G
innodb_log_files_in_group = 3
innodb_redo_log_capacity = 6G
innodb_max_undo_log_size = 4G
# 根据您的服务器IOPS能力适当调整
# 一般配普通SSD盘的话,可以调整到 10000 - 20000
# 配置高端PCIe SSD卡的话,则可以调整的更高,比如 50000 - 80000
innodb_io_capacity = 4000
innodb_io_capacity_max = 8000
innodb_open_files = 65535
innodb_flush_method = O_DIRECT
innodb_lru_scan_depth = 4000
innodb_lock_wait_timeout = 10
innodb_rollback_on_timeout = 1
innodb_print_all_deadlocks = 1
innodb_online_alter_log_max_size = 4G
innodb_print_ddl_logs = 0
innodb_status_file = 1
#注意: 开启 innodb_status_output & innodb_status_output_locks 后, 可能会导致log_error文件增长较快
innodb_status_output = 0
innodb_status_output_locks = 1
innodb_sort_buffer_size = 67108864
innodb_adaptive_hash_index = 0
#开启NUMA支持
innodb_numa_interleave = ON
innodb_print_lock_wait_timeout_info = 1
#自动杀掉超过5分钟不活跃事务,避免行锁被长时间持有
kill_idle_transaction = 300

#innodb monitor settings
#innodb_monitor_enable = "module_innodb,module_server,module_dml,module_ddl,module_trx,module_os,module_purge,module_log,module_lock,module_buffer,module_index,module_ibuf_system,module_buffer_page,module_adaptive_hash"

#innodb parallel query
loose-force_parallel_execute = OFF
loose-parallel_default_dop = 8
loose-parallel_max_threads = 96
temptable_max_ram = 8G

#pfs settings
performance_schema = 1
#performance_schema_instrument = '%memory%=on'
performance_schema_instrument = '%lock%=on'


全部回复(4)
KAiTO 2024-2-28 13:21:24
您跟着手册一步一步来吧,等安装成功一次以后再尝试做更改。
你的my.cnf没有贴完全,而且你重装的话要把原数据目录datadir这个指向的路径文件清空
cse_engineer 2024-2-28 15:28:54
KAiTO 发表于 2024-2-28 13:21
您跟着手册一步一步来吧,等安装成功一次以后再尝试做更改。
你的my.cnf没有贴完全,而且你重装的话要把原 ...

大佬,我把之前的datadir清空了,重新安装后还是报这个错误,有啥线索么?
my.cnf重新贴了。
cse_engineer 2024-2-28 15:59:10
KAiTO 发表于 2024-2-28 13:21
您跟着手册一步一步来吧,等安装成功一次以后再尝试做更改。
你的my.cnf没有贴完全,而且你重装的话要把原 ...

根因在于 没有配对环境变量, mysql客户端用的mariadb.
KAiTO 2024-2-28 15:59:10
cse_engineer 发表于 2024-2-28 15:28
大佬,我把之前的datadir清空了,重新安装后还是报这个错误,有啥线索么?
my.cnf重新贴了。 ...

用户环境变量错误,mysql指向MariaDB,所以导致无法登入
所以登入前最好检查下环境变量指向

  1. $ mysql --version
  2. mysql  Ver 8.0.32-25 for Linux on x86_64 (GreatSQL, Release 25, Revision 79f57097e3f)
复制代码
确保是指向GreatSQL
----
解决方法,更换环境变量 参考:
  1. $ echo 'export PATH=/usr/local/GreatSQL-8.0.32-25-Linux-glibc2.28-x86_64/bin:$PATH' >> ~/.bash_profile
  2. $ source ~/.bash_profile
复制代码

成功解决

cse_engineer

10

主题

0

博客

32

贡献

注册会员

Rank: 2

积分
53

助人为乐(铜)勤学好问(铜)

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-28 07:04 , Processed in 0.020119 second(s), 15 queries , Redis On.
快速回复 返回顶部 返回列表