VPS侦探论坛

 找回密码
 注册
查看: 3028|回复: 6

重启后数据库无法启动

[复制链接]
发表于 2020-11-4 17:58:52 | 显示全部楼层 |阅读模式

小白一个,日志如下,军哥帮助分析下:
2020-11-04 17:52:55 19752 [Note] Plugin 'FEDERATED' is disabled.
2020-11-04 17:52:55 19752 [Note] InnoDB: Using atomics to ref count buffer pool pages
2020-11-04 17:52:55 19752 [Note] InnoDB: The InnoDB memory heap is disabled
2020-11-04 17:52:55 19752 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-11-04 17:52:55 19752 [Note] InnoDB: Memory barrier is not used
2020-11-04 17:52:55 19752 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-11-04 17:52:55 19752 [Note] InnoDB: Using Linux native AIO
2020-11-04 17:52:55 19752 [Note] InnoDB: Using CPU crc32 instructions
2020-11-04 17:52:55 19752 [Note] InnoDB: Initializing buffer pool, size = 64.0M
2020-11-04 17:52:55 19752 [Note] InnoDB: Completed initialization of buffer pool
2020-11-04 17:52:55 19752 [Note] InnoDB: Highest supported file format is Barracuda.
2020-11-04 17:52:55 19752 [Note] InnoDB: 128 rollback segment(s) are active.
2020-11-04 17:52:55 19752 [Note] InnoDB: Waiting for purge to start
2020-11-04 17:52:55 19752 [Note] InnoDB: 5.6.49 started; log sequence number 1626084
2020-11-04 17:52:55 19752 [Note] Recovering after a crash using mysql-bin
2020-11-04 17:52:55 19752 [Note] Starting crash recovery...
2020-11-04 17:52:55 19752 [Note] Crash recovery finished.
2020-11-04 17:52:55 19752 [Note] 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 [Note] 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 [Note] Server hostname (bind-address): '*'; port: 3306
2020-11-04 17:52:55 19752 [Note] IPv6 is available.
2020-11-04 17:52:55 19752 [Note]   - '::' resolves to '::';
2020-11-04 17:52:55 19752 [Note] Server socket created on IP: '::'.
2020-11-04 17:52:55 19752 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it


美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2020-11-4 19:35:27 | 显示全部楼层


mysql配置文件你做过什么变动?顺便贴mysql配置文件看一下
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-11-4 19:40:36 来自手机 | 显示全部楼层

没变动,从5.4升级到5.6
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2020-11-4 19:45:16 | 显示全部楼层



  1. [client]
  2. #password   = your_password
  3. port        = 3306
  4. socket      = /tmp/mysql.sock

  5. [mysqld]
  6. port        = 3306
  7. socket      = /tmp/mysql.sock
  8. datadir = /usr/local/mysql/var
  9. skip-external-locking
  10. key_buffer_size = 16M
  11. max_allowed_packet = 1M
  12. table_open_cache = 64
  13. sort_buffer_size = 512K
  14. net_buffer_length = 8K
  15. read_buffer_size = 256K
  16. read_rnd_buffer_size = 512K
  17. myisam_sort_buffer_size = 8M
  18. thread_cache_size = 8
  19. query_cache_size = 8M
  20. tmp_table_size = 16M
  21. performance_schema_max_table_instances = 500

  22. explicit_defaults_for_timestamp = true
  23. #skip-networking
  24. max_connections = 500
  25. max_connect_errors = 100
  26. open_files_limit = 65535

  27. log-bin=mysql-bin
  28. binlog_format=mixed
  29. server-id   = 1
  30. expire_logs_days = 10

  31. #loose-innodb-trx=0
  32. #loose-innodb-locks=0
  33. #loose-innodb-lock-waits=0
  34. #loose-innodb-cmp=0
  35. #loose-innodb-cmp-per-index=0
  36. #loose-innodb-cmp-per-index-reset=0
  37. #loose-innodb-cmp-reset=0
  38. #loose-innodb-cmpmem=0
  39. #loose-innodb-cmpmem-reset=0
  40. #loose-innodb-buffer-page=0
  41. #loose-innodb-buffer-page-lru=0
  42. #loose-innodb-buffer-pool-stats=0
  43. #loose-innodb-metrics=0
  44. #loose-innodb-ft-default-stopword=0
  45. #loose-innodb-ft-inserted=0
  46. #loose-innodb-ft-deleted=0
  47. #loose-innodb-ft-being-deleted=0
  48. #loose-innodb-ft-config=0
  49. #loose-innodb-ft-index-cache=0
  50. #loose-innodb-ft-index-table=0
  51. #loose-innodb-sys-tables=0
  52. #loose-innodb-sys-tablestats=0
  53. #loose-innodb-sys-indexes=0
  54. #loose-innodb-sys-columns=0
  55. #loose-innodb-sys-fields=0
  56. #loose-innodb-sys-foreign=0
  57. #loose-innodb-sys-foreign-cols=0

  58. default_storage_engine = InnoDB
  59. innodb_data_home_dir = /usr/local/mysql/var
  60. innodb_data_file_path = ibdata1:10M:autoextend
  61. innodb_log_group_home_dir = /usr/local/mysql/var
  62. innodb_buffer_pool_size = 64M
  63. innodb_log_file_size = 5M
  64. innodb_log_buffer_size = 8M
  65. innodb_flush_log_at_trx_commit = 1
  66. innodb_lock_wait_timeout = 50

  67. [mysqldump]
  68. quick
  69. max_allowed_packet = 16M

  70. [mysql]
  71. no-auto-rehash

  72. [myisamchk]
  73. key_buffer_size = 20M
  74. sort_buffer_size = 20M
  75. read_buffer = 2M
  76. write_buffer = 2M

  77. [mysqlhotcopy]
  78. interactive-timeout

复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2020-11-4 20:33:12 | 显示全部楼层

谢谢军哥,小白真的不知道怎么解决?麻烦军哥

军哥运维代购:http://shop63846532.taobao.com/

发表于 2020-11-5 08:15:32 | 显示全部楼层

提供升级日志看下
先备份数据库目录,然后执行命令:
/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
mysql
repair table  mysql.user;
然后看看返回信息是否报错
kill `pidof mysqld`
再启动mysql看一下
 楼主| 发表于 2020-11-5 14:11:01 | 显示全部楼层

按照军哥说的已经解决,谢谢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 21:22 , Processed in 0.027664 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表