问题:
尝试创建新的mysql用户时获取Cannot load from mysql.procs_priv. The table is probably corrupted
。
平台:OSX Yosemite,Homebrew
已尝试其他答案的解决方案:
mysql_upgrade -uroot -p
--force
:This installation of MySQL is already upgraded to 5.7.9, use --force if you still need to run mysql_upgrade
--skip-version-check
,因为:Error: Server version (5.7.18) does not match with the version of the server (5.7.9) with which this program was built/distributed. You can use --skip-version-check to skip this check.
CREATE USER 'newuser';
,仍会引发相同的错误。char
中的所有mysql.procs_priv
列更改为varchar
,as suggested here。好吧,他建议改为text
,但对于核心mysql表来说这似乎太疯狂了。答案 0 :(得分:2)
完全删除mysql并重新安装它(不到15分钟)。
<强> 1。卸载并从系统中清除MYSQL
ps -ax | grep mysql
卸载mysql
brew remove mysql
brew cleanup
删除所有残留文件
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
卸载以前的自动登录
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
删除以前的配置。从MYSQLCOM=-YES-
/etc/hostconfig
删除以前的偏好
sudo rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*
sudo rm -rf /private/var/db/receipts/*mysql*
sudo rm -rf /private/var/mysql
可选,重新启动计算机。我没有。
<强> 2。安装MYSQL
安装Mysql
brew install mysql
设置为在启动时运行
brew services start mysql
保护安装
mysql_secure_installation
答案 1 :(得分:2)
我认为最好使用它:
mysql_upgrade -u root -p
输入您的密码并等待几秒钟。