我正在尝试按照此链接中的方法在MAC OS版本10.11.2上安装mysql ,
以下命令已成功执行,
brew install mysql
但是当我输入以下命令时
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
我收到以下错误:
mysql_install_db: [ERROR] unknown variable 'tmpdir=/tmp' 2015-12-17 17:35:54 [ERROR] Unrecognized options
请帮忙.提前致谢.
所有功劳都归功于编码器墙
完全删除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
编辑/ 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*
编辑〜/ .bash_profile并删除mysql或mysqlAdmin的所有别名
重新启动计算机只是为了确保任何MySQL进程被杀死尝试运行mysql,它应该不起作用
用Homebrew重新安装MySQL
brew doctor
brew update
brew install mysql
unset TMPDIR
mysqld -initialize --log-error-verbosity --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start
brew services start mysql
尝试运行它,它对我有用.(从这里的评论中得到)
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
在这里张贴以防万一有人遇到与我相同的问题.