Return to site

Access denied for user 'root'@'localhost' in mac

broken image
broken image

Open a new terminal window/tab: sudo /usr/local/mysql-8.0.15-macos10.14-x86_64/bin/mysql -u root Start MySQL with this command: sudo /usr/local/mysql-8.0.15-macos10.14-x86_64/bin/mysqld_safe -skip-grant-tables

broken image

Or just Check > System preferences > MySQL > if the server is running, stop it. The installation folder might vary per user, BE AWARE! Restart MySQL, either through System Preferences > MySql or using a command.īUT THIS ACTUALLY WORKED: sudo /usr/local/mysql-8.0.15-macos10.14-x86_64/support-files/rver stop

broken image

UPDATE USER SET AUTHENTICATION_STRING=password('NewPassword') WHERE user='root' $mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root' ī) If you see ERROR 1046 (3D000): No database selected, then run this command first:Ĭ) If you see unknown 'Password' field error, then run this command: $mysql> UPDATE user SET authentication_string=PASSWORD('my_password') WHERE User='root' Ī) The command for MySql versions before 5.7 was: Sudo /usr/local/mysql/bin/mysqld_safe -skip-grant-tables You can also check System Preferences > MySQL to see if it is running Sudo /usr/local/mysql/support-files/rver stop Open a Terminal window, use the command below to stop mysql if it's already running. You can do the following on Mac (El Capitan)