Loading
0

解决:Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

技术小学生微信公众号
腾讯云服务器大促销。
华为服务器
前言:在Centos7.x上通过RPM包安装了mysql5.6后无法启动,通过err错误日志看有报错: mysqld: Table 'mysql.plugin' doesn't exist ,120221 2:17:24 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 按照如下方法解决了,希望对大家有帮助:
提示:如果是生产环境或有重要数据,请在操作前务必做好数据备份或快照,以免数据丢失
报错:

2024-07-08 14:45:20 3070 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
2024-07-08 14:45:20 3070 [ERROR] Can't open the mysql.plugin table. Please run
mysql_upgrade to create it.
2024-07-08 14:45:20 3070 [Note] InnoDB: Using atomics to ref count buffer pool pages
2024-07-08 14:45:20 3070 [Note] InnoDB: The InnoDB memory heap is disabled
2024-07-08 14:45:20 3070 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2024-07-08 14:45:20 3070 [Note] InnoDB: Memory barrier is not used
2024-07-08 14:45:20 3070 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-07-08 14:45:20 3070 [Note] InnoDB: Using Linux native AIO
2024-07-08 14:45:20 3070 [Note] InnoDB: Using CPU crc32 instructions
2024-07-08 14:45:20 3070 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2024-07-08 14:45:20 3070 [Note] InnoDB: Completed initialization of buffer pool
2024-07-08 14:45:20 3070 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2024-07-08 14:45:20 3070 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB

解决方法:
根据 error 中的提示 我们可以使用 mysql_upgrade 来修复问题:
执行如下命令修复:

mysql_install_db --user=mysql

出现如图则表示正常。


最后再启动mysql即可。问题很简单,留个记号防止忘记。
技术小学生微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://blog.tag.gg/showinfo-3-36348-0.html
亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
上一篇:Centos7.x安装mysql5.6/5.7的2个方法
下一篇:返回列表