报错信息:

2021-06-16T03:32:40.954339Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: 'user' (errno: 2 - No such file or directory)
2021-06-16T03:32:40.955117Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2021-06-16T03:32:40.956219Z 0 [ERROR] Aborting
2021-06-16T03:32:40.936371Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

原因

因为是mysql data数据目录是直接拷贝,造成data/mysql 里面的配置文件和用户数据不一致导致的

解决方法

1、旧的data目录备份
2、初始化数据库,mysqld --initialize
3、拷贝初始化后的data/mysql到旧的data目录
4、将原来的data删除,然后旧的data目录修改为data目录
5、重启mysql命令

 

相关文章:

  • 2022-12-23
  • 2021-09-21
  • 2022-02-03
  • 2021-05-07
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案