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 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
Please help. Thanks in advance.
The free download for the Mac is the MySQL Community Server edition. Go to the MySQL website and download the latest version of MySQL for MacOS. Select the native package DMG archive version, not the compressed TAR version. Click the Download button next to the version you choose.
MySQL for macOS is available in a number of different forms: Native Package Installer, which uses the native macOS installer (DMG) to walk you through the installation of MySQL. For more information, see Chapter 2, Installing MySQL on macOS Using Native Packages. You can use the package installer with macOS.
All credit goes to coder wall
Remove MySQL completely
ps -ax | grep mysql
stop and kill any MySQL processesbrew 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
- edit /etc/hostconfig and remove the line 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*
- edit ~/.bash_profile and remove any aliases for mysql or mysqlAdmin
- restart your computer just to ensure any MySQL processes are killed try to run mysql, it shouldn't work
Reinstall MySQL with Homebrew
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With