问题:
获取Cannot load from mysql.procs_priv. The table is probably corrupted尝试创建新的mysql用户时.
平台: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,因为这里建议.好吧,他建议改为text但对核心mysql表来说这似乎太疯狂了.小智 8
我认为使用这个会更好:
mysql_upgrade -u root -p
Run Code Online (Sandbox Code Playgroud)
输入您的密码并等待几秒钟。
完全删除 mysql 并重新安装它有效(不到 15 分钟)。
1. 从系统中卸载并清除 MYSQL
ps -ax | grep mysql卸载mysql
brew remove mysql
brew cleanup
Run Code Online (Sandbox Code Playgroud)删除所有残留文件
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*
Run Code Online (Sandbox Code Playgroud)卸载之前的自动登录
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Run Code Online (Sandbox Code Playgroud)删除之前的配置。删除该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
Run Code Online (Sandbox Code Playgroud)可选,重新启动计算机。我没有。
2.安装MySQL
安装MySQL
brew install mysql
Run Code Online (Sandbox Code Playgroud)设置为启动时运行
brew services start mysql
Run Code Online (Sandbox Code Playgroud)确保安装安全
mysql_secure_installation
Run Code Online (Sandbox Code Playgroud)