MySQL部署时提示Table mysql.plugin doesn’t exist的解决方法
今天部署了免安装版的MySQL,出现了Table'mysql.plugin'doesn'texist的问题,苦恼了好久,终于在网上找到了解决方案,现整理一下给大家分享:
系统环境:Win1064位
MySQL版本:mysql-5.7.17-winX64
部署的步骤就是按照网上说的:
1:修改环境变量path,增加值C:\ProgramFiles\mysql-5.7.17-winX64\bin
2:修改my-default.ini,重命名为my.ini,修改文件内容:
#basedir=C:\ProgramFiles\mysql-5.7.17-winX64 #datadir=C:\ProgramFiles\mysql-5.7.17-winX64\data
在主目录“C:\ProgramFiles\mysql-5.7.17-winX64”下创建空的data文件夹;
3:管理员运行cmd,输入:mysqld-install,显示安装成功;再输入:netstartmysql,提示启动服务失败,
此时:到data文件夹下看到5个文件,打开后缀为.err的文件,里面提示:Table'mysql.plugin'doesn'texist
针对这个问题的解决方案是:
1.把my.ini复制到\bin文件夹下;
2.在cmd到\bin目录,然后输入mysqld--initialize--user=mysql--console执行此命令,生成库.注意有个临时密码,要记下来;
3.启动服务netstartmysql;
4.进入mysql命令下:mysql-uroot-p,输入刚刚的密码;
5.再输入setpassword=password('root')修改root的登录密码;
我按照此操作成功了,希望对各位能有帮助。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。