Hello people,
Let's learn how to reset mysql root password?
Come on !!!
First
You must stop the MySQL service running on your machine. To stop running the following command:
/etc/init.d/mysql stop
Now
From the terminal, go to the folder where MySQL is installed, which should look something like /etc/mysql/mysql.conf.d/ and open the mysqld.cnf file with a text editor of your choice. Edit the open, skip-grant-tables file under the [mysqld] save entry.
NOTE: Without the parentheses
Go back to the terminal and restart the MySQL service that was stopped.
/etc/init.d/mysql restart
That done, go through the terminal and type
mysql -u root
Enter and type:
update user set authentication_string="" where User='root'
This will make the user root the new password you entered.
To complete the process Go back to the terminal, stop MySQL, go back to the mysqld.cnf file, remove an inserted row skip-grant-tables and save. Restart the MySQL service and test access now with a new root password. So that's it, there are not many secrets to this tutorial and you already have a minimal notion of the files in your development environment.
Note: If you use the database docker use the command below to access the database settings and follow the tutorial above.
sudo docker exec -it bash
Comentários
Postar um comentário