mysql 启动报错 Could not open mysql.plugin table 的修复

mysql突然崩,重启就打不开了,将data目录下的东西删了一些,很不幸,删多了,只得寻求恢复办法,直接备份整个data目录,新建一个data空目录,尝试启动mysql,发现有报错Could not open mysql.plugin table. Some plugins may be not loaded

mysql_error.log报错信息:

InnoDB: using atomic writes.
2020-12-16 16:30:39 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-12-16 16:30:39 0 [Note] InnoDB: Uses event mutexes
2020-12-16 16:30:39 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-12-16 16:30:39 0 [Note] InnoDB: Number of pools: 1
2020-12-16 16:30:39 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-12-16 16:30:39 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-12-16 16:30:39 0 [Note] InnoDB: Completed initialization of buffer pool
2020-12-16 16:30:39 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-12-16 16:30:39 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-12-16 16:30:39 0 [Note] InnoDB: Setting file 'D:\xampp72\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-12-16 16:30:39 0 [Note] InnoDB: File 'D:\xampp72\mysql\data\ibtmp1' size is now 12 MB.
2020-12-16 16:30:39 0 [Note] InnoDB: Waiting for purge to start
2020-12-16 16:30:39 0 [Note] InnoDB: 10.4.11 started; log sequence number 47064; transaction id 9
2020-12-16 16:30:39 0 [Note] InnoDB: Loading buffer pool(s) from D:\xampp72\mysql\data\ib_buffer_pool
2020-12-16 16:30:39 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-12-16 16:30:39 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2020-12-16 16:30:39 0 [Note] InnoDB: Buffer pool(s) load completed at 201216 16:30:39
2020-12-16 16:30:39 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2020-12-16 16:30:39 0 [Note] Server socket created on IP: '::'.

里面重要的两句的[ERROR]级别的错误:

Could not open mysql.plugin table. Some plugins may be not loaded

 Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist

大概意思是权限表,插件表都找不到,因为空的data目录下连mysql库都没有,启动不了那才是正常的。

修复

找到mysql安装目录下的bin目录,运行:

mysql_install_db

这个就相当于初始化一下,会发现有了mysql和一些其他必要的库,此时默认的用户是root,并且是没有设置密码的,此时已经可以正常启动mysql了。

设置root用户密码:

还是在mysql安装目录下的bin目录下,运行:

mysqladmin -u root password

输入两遍密码即可正常。

mysql 启动报错 Could not open mysql.plugin table 的修复

原文链接:https://beltxman.com/3316.html,若无特殊说明本站内容为 行星带 原创,未经同意禁止转载。

Scroll to top