Mysql Install For Mac

Mysql Install For Mac 9,1/10 1013 votes

Mac OS X has a great design and a lot of tasks are really easy to do. Unfortunately if you want to have MySQL server installed on your Mac this is not always as.

I'm trying to setup up MySQL on mac os 10.6 using Homebrew by brew install mysql 5.1.52. Everything goes well and I am also successful with the mysql_install_db. However when I try to connect to the server using: /usr/local/Cellar/mysql/5.1.52/bin/mysqladmin -u root password 'mypass' I get: /usr/local/Cellar/mysql/5.1.52/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)' I've tried to access mysqladmin or mysql using -u root -proot as well, but it doesn't work with or without password. This is a brand new installation on a brand new machine and as far as I know the new installation must be accessible without a root password. I also tried: /usr/local/Cellar/mysql/5.1.52/bin/mysql_secure_installation but I also get ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO). I think one can end up in this position with older versions of mysql already installed.

I had the same problem and none of the above solutions worked for me. I fixed it thus: Used brew's remove & cleanup commands, unloaded the launchctl script, then deleted the mysql directory in /usr/local/var, deleted my existing /etc/my.cnf (leave that one up to you, should it apply) and launchctl plist Updated the string for the plist. Note also your alternate security script directory will be based on which version of MySQL you are installing.

Had the same problem. Seems like there is something wrong with the set up instructions or the initial tables that are being created. This is how I got mysqld running on my machine.

If the mysqld server is already running on your Mac, stop it first with: launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist Start the mysqld server with the following command which lets anyone log in with full permissions. Mysqld_safe --skip-grant-tables Then run mysql -u root which should now let you log in successfully without a password. The following command should reset all the root passwords. UPDATE mysql.user SET Password=PASSWORD('NewPassword') WHERE User='root'; FLUSH PRIVILEGES; Now if you kill the running copy of mysqld_safe and start it up again without the skip-grant-tables option, you should be able to log in with mysql -u root -p and the new password you just set. Okay I had the same issue and solved it.

Mysql Install For Mac

For some reason the mysql_secure_installation script doesn't work out of the box when using Homebrew to install mysql, so I did it manually. On the CLI enter: mysql -u root That should get you into mysql.

Now do the following (taken from mysql_secure_installation): UPDATE mysql.user SET Password=PASSWORD('your_new_pass') WHERE User='root'; DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); DELETE FROM mysql.user WHERE User='; DELETE FROM mysql.db WHERE Db='test' OR Db='test _%' DROP DATABASE test; FLUSH PRIVILEGES; Now exit and get back into mysql with: mysql -u root -p. I had the same problem just now. If you brew info mysql and follow the steps it looks like the root password should be new-password if I remember correctly. I was seeing the same thing you are seeing.

Helped me the most. It turned out I didn't have any accounts created for me. When I logged in after running mysqld_safe and did select * from user; no rows were returned. I opened the MySQLWorkbench with the mysqld_safe running and added a root account with all the privs I expected. Outlook search is not working in mac. This are working well for me now. If mysql is already installed Stop mysql completely. • mysql.server stop.