卸载所有破坏的MySQL版本并重新安装

・2 分钟阅读

完全删除MySQL 技术实验室

  • ps -ax | grep mysql
  • 停止和kill任何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
  • 编辑/etc/hostconfig,并且删除行MYSQLCOM=-YES-
  • 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*
  • 重启你的计算机以确保任何MySQL进程都被杀死
  • 尝试运行mysql,它不应该工作,

Brew为每个用户Sedorner安装MySQL

  • brew doctor并修复任何错误
  • brew update
  • brew install mysql
  • unset TMPDIR
  • mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
  • mysql.server start
  • 运行Brew建议,将MySQL添加到launchctl,以便在启动时自动启动,

mysql现在应该正常工作,并且按照预期运行

Godspeed 。

Ayn profile image