I messed up something and I try creating a local server in the mysql workbench but an error message show up every time I test the connection.
I tried uninstalling the mysql workbench and installing again but the for user "root" is unknown. It did not tell anything about the root password during the installation process and I tried various password like empty string, my mac password etc but none of them works, I try researching in stackoverflow but I still cannot solve it.
For MAC user / OSX user
Try the command FLUSH PRIVILEGES
when you log into the MySQL terminal. If that doesn't work, try the following set of commands while in the MySQL terminal
$ mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET password=PASSWORD("NEWPASSWORD") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
Change out NEWPASSWORD
with whatever password you want. Should be all set!
Update:
As of MySQL 5.7, the password field has been renamed authentication_string
. When changing the password, use the following query to change the password. All other commands remain the same:
mysql> UPDATE user SET authentication_string=PASSWORD("NEWPASSWORD") WHERE User='root';
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments