brew在mac os el capitan上安装mysql。

时间:2022-01-14 02:41:25

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完全

  1. ps -ax | grep mysql stop and kill any MySQL processes
  2. ps -ax | grep mysql停止并杀死任何mysql进程
  3. brew remove mysql
  4. 酿造删除mysql
  5. brew cleanup
  6. 啤酒清理
  7. sudo rm /usr/local/mysql
  8. sudo rm /usr/local/mysql
  9. sudo rm -rf /usr/local/var/mysql
  10. sudo rm射频/usr/local/var/mysql
  11. sudo rm -rf /usr/local/mysql*
  12. sudo rm射频/usr/local/mysql*
  13. sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  14. sudo rm ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
  15. sudo rm -rf /Library/StartupItems/MySQLCOM
  16. sudo rm射频/图书馆/ StartupItems / MySQLCOM
  17. sudo rm -rf /Library/PreferencePanes/My*
  18. sudo rm射频/图书馆/ PreferencePanes /我的*
  19. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  20. launchctl卸载- w ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
  21. edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  22. 编辑/etc/hostconfig并删除行MYSQLCOM=- yes -
  23. rm -rf ~/Library/PreferencePanes/My*
  24. rm射频~ /图书馆/ PreferencePanes /我的*
  25. sudo rm -rf /Library/Receipts/mysql*
  26. sudo rm射频/图书馆/收据/ mysql *
  27. sudo rm -rf /Library/Receipts/MySQL*
  28. sudo rm射频/图书馆/收据/ MySQL *
  29. sudo rm -rf /private/var/db/receipts/*mysql*
  30. sudo rm射频/私人/ var / db /收据/ * mysql *
  31. edit ~/.bash_profile and remove any aliases for mysql or mysqlAdmin
  32. 编辑~ /。bash_profile并删除mysql或mysqlAdmin的任何别名
  33. restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work
  34. 重新启动你的计算机以确保任何MySQL进程被终止尝试运行MySQL,它不应该工作

Reinstall MySQL with Homebrew

重新安装MySQL和家酿

  1. brew doctor
  2. 酿造的医生
  3. brew update
  4. 酿造更新
  5. brew install mysql
  6. 酿造安装mysql
  7. unset TMPDIR
  8. 设置TMPDIR
  9. mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
  10. mysqld -初始化-verbose -用户=whoami -basedir="$(brew -前缀mysql)"——datadir = / usr /地方/ var / mysql——tmpdir = / tmp
  11. mysql.server start
  12. mysql。服务器启动
  13. brew services start mysql
  14. 啤酒服务启动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完全

  1. ps -ax | grep mysql stop and kill any MySQL processes
  2. ps -ax | grep mysql停止并杀死任何mysql进程
  3. brew remove mysql
  4. 酿造删除mysql
  5. brew cleanup
  6. 啤酒清理
  7. sudo rm /usr/local/mysql
  8. sudo rm /usr/local/mysql
  9. sudo rm -rf /usr/local/var/mysql
  10. sudo rm射频/usr/local/var/mysql
  11. sudo rm -rf /usr/local/mysql*
  12. sudo rm射频/usr/local/mysql*
  13. sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  14. sudo rm ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
  15. sudo rm -rf /Library/StartupItems/MySQLCOM
  16. sudo rm射频/图书馆/ StartupItems / MySQLCOM
  17. sudo rm -rf /Library/PreferencePanes/My*
  18. sudo rm射频/图书馆/ PreferencePanes /我的*
  19. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  20. launchctl卸载- w ~ /图书馆/ LaunchAgents / homebrew.mxcl.mysql.plist
  21. edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  22. 编辑/etc/hostconfig并删除行MYSQLCOM=- yes -
  23. rm -rf ~/Library/PreferencePanes/My*
  24. rm射频~ /图书馆/ PreferencePanes /我的*
  25. sudo rm -rf /Library/Receipts/mysql*
  26. sudo rm射频/图书馆/收据/ mysql *
  27. sudo rm -rf /Library/Receipts/MySQL*
  28. sudo rm射频/图书馆/收据/ MySQL *
  29. sudo rm -rf /private/var/db/receipts/*mysql*
  30. sudo rm射频/私人/ var / db /收据/ * mysql *
  31. edit ~/.bash_profile and remove any aliases for mysql or mysqlAdmin
  32. 编辑~ /。bash_profile并删除mysql或mysqlAdmin的任何别名
  33. restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work
  34. 重新启动你的计算机以确保任何MySQL进程被终止尝试运行MySQL,它不应该工作

Reinstall MySQL with Homebrew

重新安装MySQL和家酿

  1. brew doctor
  2. 酿造的医生
  3. brew update
  4. 酿造更新
  5. brew install mysql
  6. 酿造安装mysql
  7. unset TMPDIR
  8. 设置TMPDIR
  9. mysqld -initialize --verbose --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
  10. mysqld -初始化-verbose -用户=whoami -basedir="$(brew -前缀mysql)"——datadir = / usr /地方/ var / mysql——tmpdir = / tmp
  11. mysql.server start
  12. mysql。服务器启动
  13. brew services start mysql
  14. 啤酒服务启动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。