48

启动mysql报错:Can’t open the mysql.plugin table.

 2 years ago
source link: https://www.huhexian.com/29760.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

启动mysql报错:Can’t open the mysql.plugin table.

青山 2022-03-0213:52:57评论840字

mysql启动时生成错误日志,详细如下:

  1. 180720 10:00:54 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
  2. 180720 10:00:54 InnoDB: Initializing buffer pool, size = 8.0M
  3. 180720 10:00:54 InnoDB: Completed initialization of buffer pool
  4. InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242881 bytes
  5. InnoDB: than specified in the .cnf file 0 5242880 bytes!
  6. 180720 10:00:54 [ERROR] Plugin 'InnoDB' init function returned error.
  7. 180720 10:00:54 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
  8. 180720 10:00:54 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

诊断原因,没有执行mysql初始化操作,缺少默认的一些相关文件,执行初始化操作即可,在命令行执行如下:

解决办法:

第一种:输入

  1. mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/

再次启动mysql就好了,但是问题没有解决,无法使用InnoDB引擎,想要使用InnoDB引擎请使用第二种方法。

使用查找文件命令找到ib_logfile0 文件:

  1. find / -name ib_logfile0

跟他在一起还有ib_logfile1文件,你只需要删除这两个文件,或者修改这两个文件名,之后再次启动mysql,就好了。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK