Created
April 18, 2018 01:55
-
-
Save MaxSouza/957072bfe643b860ab6a8b42dac3e86d to your computer and use it in GitHub Desktop.
Resetando a senha do mysql macos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you don't remember the password you set for root and need to reset it, follow these steps: | |
Stop the mysqld server, this varies per install | |
Run the server in safe mode with privilege bypass | |
sudo mysqld_safe --skip-grant-tables; | |
In a new window connect to the database, set a new password and flush the permissions & quit: | |
mysql -u root | |
For MySQL older than MySQL 5.7 use: | |
UPDATE mysql.user SET Password=PASSWORD('your-password') WHERE User='root'; | |
For MySQL 5.7+ use: | |
USE mysql; | |
UPDATE mysql.user SET authentication_string=PASSWORD("your-password") WHERE User='root'; | |
Refresh and quit: | |
FLUSH PRIVILEGES; | |
\q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment