MySQL (or mariadb, she is a branch of MySQL, completely open source, the new version of the Linux system is installed by default mariadb) How to change the root password? We mainly introduce command mysqladmin to implement.
MySQL (mariadb) How to change the root password, the first step is to switch to the root user:
MySQL (mariadb) How to change the root password, mainly using the Mysqladmin command, see the Picture:
To explain:
-U root, which is the specified user, specifying the password to modify the root user.
-p password is the password option, and the newpasswd behind it is the new password.
The results of the implementation are as follows:
After MySQL (mariadb) changes the root password, try not to enter the password into the database:
MySQL (mariadb) How to change the root password, now enter a normal password login:
Password entered correctly, log in to the database!
How MySQL (mariadb) changes the root password