If you are in the situation where you want to change the MySQL root password to Linux, from this tutorial you learn step by step how you can do this from SSH (Secure Shell).
This scenario is useful when you have forgotten the password of the user "root” for MySQL and you can no longer fully manage the databases.
After you install MySQL server pe Linux, FreeBSD, OpenBSDEtc. UNIX, the first thing you should do is to us set a passwordpowerful for the user"root".
This user "comes" with MySQL, he having no connection with the user "root"The serverof the Many beginners try to connect to MySQL with the user "root", using the server / system password, and of course the answer is "Access Denied".
How to change mysql root password in Linux (SSH)
You log in via SSH and run the command "mysqladmin
" to set the user's password "root” of the MySQL server.
mysqladmin -u root password NEW_PASSWORD
Using this command you can also change the passwords of other SQL users. Replace root with the name of the user for which you want to change the password.
How to change MySQL root password in Linux, the command executed will be the following:
mysqladmin -u root -p old_password password new_password
In the example above is the command to change the user's password root. If you want to change a user's password, the command line changes a bit.
mysqladmin -u user_name -p oldpass password newpass
Changing the password will be done immediately, without the need for other commands or settings.