I'm trying to install mysql on MAC OS version 10.11.2 by following the methods in this link,
我试图在MAC OS 10.11.2上安装mysql,按照这个链接中的方法,
The following command has been successfully executed,
以下命令已成功执行,
brew install mysql
but when I type the following command,
但是当我输入以下命令时,
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
I get the following error:
我得到以下错误:
mysql_install_db: [ERROR] unknown variable 'tmpdir=/tmp'
2015-12-17 17:35:54 [ERROR] Unrecognized options
Thanks in advance.
提前谢谢。
3 个解决方案
#1
39
All credit goes to coder wall
所有的功劳都归给了程序员
Remove MySQL completely
删除MySQL完全
ps -ax | grep mysql
stop and kill any MySQL processes- ps -ax | grep mysql停止并杀死任何mysql进程
brew remove mysql
- 酿造删除mysql
brew cleanup
- 啤酒清理
sudo rm /usr/local/mysql
- sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
- sudo rm射频/usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
- sudo rm射频/usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- sudo rm ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
- sudo rm射频/图书馆/ StartupItems / MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
- sudo rm射频/图书馆/ PreferencePanes /我的*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- launchctl卸载- w ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
- edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
- 编辑/etc/hostconfig并删除行MYSQLCOM=- yes -
rm -rf ~/Library/PreferencePanes/My*
- rm射频~ /图书馆/ PreferencePanes /我的*
sudo rm -rf /Library/Receipts/mysql*
- sudo rm射频/图书馆/收据/ mysql *
sudo rm -rf /Library/Receipts/MySQL*
- sudo rm射频/图书馆/收据/ MySQL *
sudo rm -rf /private/var/db/receipts/*mysql*
- sudo rm射频/私人/ var / db /收据/ * mysql *
- edit ~/.bash_profile and remove any aliases for mysql or mysqlAdmin
- 编辑~ /。bash_profile并删除mysql或mysqlAdmin的任何别名
- restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work
- 重新启动你的计算机以确保任何MySQL进程被终止尝试运行MySQL,它不应该工作
Reinstall MySQL with Homebrew
重新安装MySQL和家酿
brew doctor
- 酿造的医生
brew update
- 酿造更新
brew install mysql
- 酿造安装mysql
unset TMPDIR
- 设置TMPDIR
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
- mysqld -初始化-verbose -用户=whoami -basedir="$(brew -前缀mysql)"——datadir = / usr /地方/ var / mysql——tmpdir = / tmp
mysql.server start
- mysql。服务器启动
brew services start mysql
- 啤酒服务启动mysql
#2
22
Try running this, it worked for me. (Got it from the comments found here)
试着运行它,它对我有效。(从这里的评论中得知)
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Posting here just in case anyone faced the same problem as me.
在这里发帖,以防有人遇到和我一样的问题。
#3
0
Based on this link: https://bugs.launchpad.net/mysql-sandbox/+bug/1396092 and this https://blog.omgmog.net/post/installing-mysql-on-os-x-mountain-lion/ It looks like you may simply need to unset TMPDIR
prior to running the install_db command.
基于这个链接:https://bugs.launchpad.net/mysql-sandbox/+bug/1396092和这个https://blog.omgmog.net/post/installing-mysql-on-os-x-mountain-lion/看起来您可能只需要在运行install_db命令之前先解除TMPDIR。
#1
39
All credit goes to coder wall
所有的功劳都归给了程序员
Remove MySQL completely
删除MySQL完全
ps -ax | grep mysql
stop and kill any MySQL processes- ps -ax | grep mysql停止并杀死任何mysql进程
brew remove mysql
- 酿造删除mysql
brew cleanup
- 啤酒清理
sudo rm /usr/local/mysql
- sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
- sudo rm射频/usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
- sudo rm射频/usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- sudo rm ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
- sudo rm射频/图书馆/ StartupItems / MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
- sudo rm射频/图书馆/ PreferencePanes /我的*
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
- launchctl卸载- w ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
- edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
- 编辑/etc/hostconfig并删除行MYSQLCOM=- yes -
rm -rf ~/Library/PreferencePanes/My*
- rm射频~ /图书馆/ PreferencePanes /我的*
sudo rm -rf /Library/Receipts/mysql*
- sudo rm射频/图书馆/收据/ mysql *
sudo rm -rf /Library/Receipts/MySQL*
- sudo rm射频/图书馆/收据/ MySQL *
sudo rm -rf /private/var/db/receipts/*mysql*
- sudo rm射频/私人/ var / db /收据/ * mysql *
- edit ~/.bash_profile and remove any aliases for mysql or mysqlAdmin
- 编辑~ /。bash_profile并删除mysql或mysqlAdmin的任何别名
- restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work
- 重新启动你的计算机以确保任何MySQL进程被终止尝试运行MySQL,它不应该工作
Reinstall MySQL with Homebrew
重新安装MySQL和家酿
brew doctor
- 酿造的医生
brew update
- 酿造更新
brew install mysql
- 酿造安装mysql
unset TMPDIR
- 设置TMPDIR
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
- mysqld -初始化-verbose -用户=whoami -basedir="$(brew -前缀mysql)"——datadir = / usr /地方/ var / mysql——tmpdir = / tmp
mysql.server start
- mysql。服务器启动
brew services start mysql
- 啤酒服务启动mysql
#2
22
Try running this, it worked for me. (Got it from the comments found here)
试着运行它,它对我有效。(从这里的评论中得知)
mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
Posting here just in case anyone faced the same problem as me.
在这里发帖,以防有人遇到和我一样的问题。
#3
0
Based on this link: https://bugs.launchpad.net/mysql-sandbox/+bug/1396092 and this https://blog.omgmog.net/post/installing-mysql-on-os-x-mountain-lion/ It looks like you may simply need to unset TMPDIR
prior to running the install_db command.
基于这个链接:https://bugs.launchpad.net/mysql-sandbox/+bug/1396092和这个https://blog.omgmog.net/post/installing-mysql-on-os-x-mountain-lion/看起来您可能只需要在运行install_db命令之前先解除TMPDIR。