重启后数据库无法启动
小白一个,日志如下,军哥帮助分析下:2020-11-04 17:52:55 19752 Plugin 'FEDERATED' is disabled.
2020-11-04 17:52:55 19752 InnoDB: Using atomics to ref count buffer pool pages
2020-11-04 17:52:55 19752 InnoDB: The InnoDB memory heap is disabled
2020-11-04 17:52:55 19752 InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-11-04 17:52:55 19752 InnoDB: Memory barrier is not used
2020-11-04 17:52:55 19752 InnoDB: Compressed tables use zlib 1.2.11
2020-11-04 17:52:55 19752 InnoDB: Using Linux native AIO
2020-11-04 17:52:55 19752 InnoDB: Using CPU crc32 instructions
2020-11-04 17:52:55 19752 InnoDB: Initializing buffer pool, size = 64.0M
2020-11-04 17:52:55 19752 InnoDB: Completed initialization of buffer pool
2020-11-04 17:52:55 19752 InnoDB: Highest supported file format is Barracuda.
2020-11-04 17:52:55 19752 InnoDB: 128 rollback segment(s) are active.
2020-11-04 17:52:55 19752 InnoDB: Waiting for purge to start
2020-11-04 17:52:55 19752 InnoDB: 5.6.49 started; log sequence number 1626084
2020-11-04 17:52:55 19752 Recovering after a crash using mysql-bin
2020-11-04 17:52:55 19752 Starting crash recovery...
2020-11-04 17:52:55 19752 Crash recovery finished.
2020-11-04 17:52:55 19752 RSA private key file not found: /usr/local/mysql/var//private_key.pem. Some authentication plugins will not work.
2020-11-04 17:52:55 19752 RSA public key file not found: /usr/local/mysql/var//public_key.pem. Some authentication plugins will not work.
2020-11-04 17:52:55 19752 Server hostname (bind-address): '*'; port: 3306
2020-11-04 17:52:55 19752 IPv6 is available.
2020-11-04 17:52:55 19752 - '::' resolves to '::';
2020-11-04 17:52:55 19752 Server socket created on IP: '::'.
2020-11-04 17:52:55 19752 Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it
mysql配置文件你做过什么变动?顺便贴mysql配置文件看一下 没变动,从5.4升级到5.6
#password = your_password
port = 3306
socket = /tmp/mysql.sock
port = 3306
socket = /tmp/mysql.sock
datadir = /usr/local/mysql/var
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
thread_cache_size = 8
query_cache_size = 8M
tmp_table_size = 16M
performance_schema_max_table_instances = 500
explicit_defaults_for_timestamp = true
#skip-networking
max_connections = 500
max_connect_errors = 100
open_files_limit = 65535
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
expire_logs_days = 10
#loose-innodb-trx=0
#loose-innodb-locks=0
#loose-innodb-lock-waits=0
#loose-innodb-cmp=0
#loose-innodb-cmp-per-index=0
#loose-innodb-cmp-per-index-reset=0
#loose-innodb-cmp-reset=0
#loose-innodb-cmpmem=0
#loose-innodb-cmpmem-reset=0
#loose-innodb-buffer-page=0
#loose-innodb-buffer-page-lru=0
#loose-innodb-buffer-pool-stats=0
#loose-innodb-metrics=0
#loose-innodb-ft-default-stopword=0
#loose-innodb-ft-inserted=0
#loose-innodb-ft-deleted=0
#loose-innodb-ft-being-deleted=0
#loose-innodb-ft-config=0
#loose-innodb-ft-index-cache=0
#loose-innodb-ft-index-table=0
#loose-innodb-sys-tables=0
#loose-innodb-sys-tablestats=0
#loose-innodb-sys-indexes=0
#loose-innodb-sys-columns=0
#loose-innodb-sys-fields=0
#loose-innodb-sys-foreign=0
#loose-innodb-sys-foreign-cols=0
default_storage_engine = InnoDB
innodb_data_home_dir = /usr/local/mysql/var
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/var
innodb_buffer_pool_size = 64M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
quick
max_allowed_packet = 16M
no-auto-rehash
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
interactive-timeout
谢谢军哥,小白真的不知道怎么解决?麻烦军哥 提供升级日志看下
先备份数据库目录,然后执行命令:
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
mysql
repair tablemysql.user;
然后看看返回信息是否报错
kill `pidof mysqld`
再启动mysql看一下
按照军哥说的已经解决,谢谢
页:
[1]