简体   繁体   English

无法打开mysql.plugin表。 请运行mysql_upgrade来创建它

[英]Can't open the mysql.plugin table. Please run mysql_upgrade to create it

I have downloaded mysql ZIP from here https://dev.mysql.com/downloads/file/?id=467269 我从这里下载了mysql ZIP https://dev.mysql.com/downloads/file/?id=467269

Then extracted it, renamed my-default.ini to my.ini , set 然后将其解压缩,将my-default.ini重命名为my.ini ,设置

basedir = D:\Apps\MySQL\mysql-5.7.17-winx64
datadir = D:\Apps\MySQL\data5717

then started 然后开始了

mysqld --console

under admin privileges. 在管理员权限下。 All was described here: http://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html 所有内容都在这里描述: http//dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html

Unfortunately it prints the following in console: 不幸的是它在控制台中打印以下内容

[ERROR] Can't open the mysql.plugin table. [ERROR]无法打开mysql.plugin表。 Please run mysql_upgrade to create it. 请运行mysql_upgrade来创建它。

and doesn't work. 并且不起作用。

You probably misunderstood/skipped point 4 in your list, Initialize MySQL . 你可能误解/跳过列表中的第4点, 初始化MySQL It means to either copy an existing data directory there or to create a new one, see Initializing the Data Directory Manually Using mysqld . 这意味着要么复制现有数据目录要么创建新数据目录,请参阅使用mysqld手动初始化数据目录

To initialize a fresh data directory, you basically (after setting your config file) just have to run either 要初始化一个新数据目录,基本上(在设置配置文件之后)只需要运行

bin\mysqld --initialize

or 要么

bin\mysqld --initialize-insecure

The latter will set an empty root password. 后者将设置一个空的root密码。

If you set datadir to some other location than basedir, like we do, then you have to COPY, not move, the basedir databases there too. 如果你将datadir设置为basedir之外的其他位置,就像我们一样,那么你必须复制而不是移动基础数据库。 Apparently mysqld looks for some of it's own stuff in the wrong place. 显然,mysqld在错误的地方寻找一些自己的东西。 After the copy you have to change the owner and group of everything you copied to mysql. 复制后,您必须更改复制到mysql的所有内容和组。

sudo cp -R /usr/local/mysql/data/* /your/own/data/place sudo chown -R mysql:mysql /your/own/data/place sudo cp -R / usr / local / mysql / data / * / your / own / data / place sudo chown -R mysql:mysql / your / own / data / place

BTW you can't just change the basedir to match the new datadir after the copy. 顺便说一下,你不能只是在复制后更改basedir以匹配新的datadir。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM