brew install mysql on mac os el capitan

前端 未结 3 1149
Happy的楠姐
Happy的楠姐 2021-01-30 18:09

I\'m trying to install mysql on MAC OS version 10.11.2 by following the methods in this link,

The following command has been successfully executed,

brew          


        
相关标签:
3条回答
  • 2021-01-30 18:23

    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.

    0 讨论(0)
  • 2021-01-30 18:36

    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.

    0 讨论(0)
  • 2021-01-30 18:46

    All credit goes to coder wall

    Remove MySQL completely

    1. ps -ax | grep mysql stop and kill any MySQL processes
    2. brew remove mysql
    3. brew cleanup
    4. sudo rm /usr/local/mysql
    5. sudo rm -rf /usr/local/var/mysql
    6. sudo rm -rf /usr/local/mysql*
    7. sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    8. sudo rm -rf /Library/StartupItems/MySQLCOM
    9. sudo rm -rf /Library/PreferencePanes/My*
    10. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    11. edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
    12. rm -rf ~/Library/PreferencePanes/My*
    13. sudo rm -rf /Library/Receipts/mysql*
    14. sudo rm -rf /Library/Receipts/MySQL*
    15. sudo rm -rf /private/var/db/receipts/*mysql*
    16. edit ~/.bash_profile and remove any aliases for mysql or mysqlAdmin
    17. restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work

    Reinstall MySQL with Homebrew

    1. brew doctor
    2. brew update
    3. brew install mysql
    4. unset TMPDIR
    5. mysqld -initialize --log-error-verbosity --user=whoami --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
    6. mysql.server start
    7. brew services start mysql
    0 讨论(0)
提交回复
热议问题