MySQL is a popular relational database management system. An important aspect of managing DBMS is to protect the security of data tables and other objects. In MySQL, creating a user is relatively simple, but changing a user's password requires following certain steps. Let's take a closer look at how to change a user's password in MySQL.
mysql -u root -p
When we run the above command, we will be asked to enter the password of the MySQL root user. After entering it, you can enter MySQL.
mysql> UPDATE user SET Password=PASSWORD('new_password') WHERE user='user_name';
The name of the user who needs to change the password is "user_name", and his new password is "new_password". When we run this command, the user's password is changed.
mysql> FLUSH PRIVILEGES;
This command reloads the database permission and refreshes the cache, so You can also make password changes take effect.
##mysql> quit ;
MySQL is an excellent relational database management system. When allowing user password changes, we need to operate them one by one. After the changes are completed, we need to refresh the database. We have all these details. Need to master. When we operate these steps very skillfully, it will definitely have a good effect on our MySQL management and maintenance.
The above is the detailed content of mysql change user password. For more information, please follow other related articles on the PHP Chinese website!