MySQL mysql_upgrade - 致命错误:升级失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22564509/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mysql_upgrade - FATAL ERROR: Upgrade Failed
提问by seaBass
I recently had my MySQL server upgraded from 5.1 to 5.5 and I'm trying to upgrade my databases using mysql_upgrade but I keep getting this error:
我最近将 MySQL 服务器从 5.1 升级到 5.5,我正在尝试使用 mysql_upgrade 升级我的数据库,但我不断收到此错误:
[root@ip-??-???-???-??? ~]# mysql_upgrade -uadmin -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
FATAL ERROR: Upgrade failed
I can't figure why this won't run. MySQL Server is running.
我不明白为什么这不会运行。MySQL 服务器正在运行。
回答by
I had the same issue going from MySQL 5.5 to 5.6 on OS X (installed via MacPorts).
我在 OS X(通过 MacPorts 安装)上从 MySQL 5.5 到 5.6 遇到了同样的问题。
Seems that mysql_upgrade
needs to be run as user root
and only root
and a password needs to be set up for the user. Any other user with administrative privileges does not seem work.
似乎mysql_upgrade
需要以用户身份运行,root
并且只root
需要为用户设置密码。任何其他具有管理权限的用户似乎都不起作用。
So the only valid command seems to be: mysql_upgrade -u root -p
所以唯一有效的命令似乎是: mysql_upgrade -u root -p
Initial solution by Chris_H at FreeBSD forums.
Chris_H 在 FreeBSD 论坛上的初步解决方案。
回答by Giuseppe Picciano
Worked for me, but I had to use this:
为我工作,但我不得不使用这个:
mysql_upgrade --port=3306 --user=root --password=PASSWORD
I work on
我工作
mysql -V
mysql Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (x86_64) using readline 6.3
mysql Ver 14.14 Distrib 5.5.35,用于 debian-linux-gnu (x86_64) 使用 readline 6.3
回答by Steve
If you run MySQL on a non-standard port be sure to include --port=xxxxxx
如果您在非标准端口上运行 MySQL,请确保包含 --port=xxxxxx
I found that skipping that can cause the error you're getting.
我发现跳过可能会导致您遇到的错误。
回答by Aman Aggarwal
For my case, I need to pass my socket file location explicitly.
对于我的情况,我需要明确传递我的套接字文件位置。
mysql_upgrade -S /usr/local/mysql/mysql.sock
回答by Javier Crego
The FATAL ERROR is solved:
致命错误已解决:
1o - Execute shell command: service mysqld stop
1o - 执行 shell 命令: service mysqld stop
2o - Then, rename /etc/my.cnf
to /etc/my.cnfbkp
2o - 然后,重命名/etc/my.cnf
为/etc/my.cnfbkp
3o - Execute shell command: service mysqld start
3o - 执行 shell 命令: service mysqld start
4o - Execute shell command: mysql_upgrade -u root -p YOUR_ROOT_PASSWORD
4o - 执行 shell 命令: mysql_upgrade -u root -p YOUR_ROOT_PASSWORD
5o - Rename /etc/my.cnfbkp
to /etc/my.cnf
5o - 重命名/etc/my.cnfbkp
为/etc/my.cnf
6o - Execute shell command: service mysqld restart
6o - 执行 shell 命令: service mysqld restart
回答by Tarv
My installation on Windows server requires port and user/pass specification.
我在 Windows 服务器上的安装需要端口和用户/密码规范。
--port=3306 --user=root --password=XXXX
回答by user3807202
Just add the configuration line to your my.cnf At the end add
只需将配置行添加到你的 my.cnf 最后添加
[mysqlcheck] socket = /dbabcstorage/data/mysql5/mysql.sock
[mysqlcheck] socket = /dabcstorage/data/mysql5/mysql.sock
the correct value you can copy in the previous lines of my.cnf
您可以在 my.cnf 的前几行中复制的正确值
回答by user1488459
This worked for me on a CentOS/Plesk server:
这在 CentOS/Plesk 服务器上对我有用:
mysql_upgrade -uadmin -p< /etc/psa/.psa.shadow
-f
mysql_upgrade -uadmin -p < /etc/psa/.psa.shadow
-f
service mysqld restart
服务 mysqld 重启
回答by Renato Mestre
SOLVED!
解决了!
Follow the steps as ADMINISTRATORaccount:
按照管理员帐户的步骤操作:
1) Install MySQL
1) 安装 MySQL
2) In the my.ini file, located on the MySQL path, set datadir e basedir
2) 在位于 MySQL 路径的 my.ini 文件中,设置 datadir e basedir
3)Move ALL THE CONTENTof "%MySQL%/Data" folder to the datadir above
3)将“%MySQL%/Data”文件夹的所有内容移动到上面的datadir
4) Run the upgrade:
4)运行升级:
mysql_upgrade
5) Create Windows Service like this:
5)像这样创建Windows服务:
sc create MySQL binPath=C:/MySQL
To remove the Windows Service:
要删除 Windows 服务:
sc delete MySQL