How to MySQL change user password
In this tutorial, How do i use MySQL change user password. MySQL and MariaDB are the popular open source Database for Linux Opearating System.
Now, How to reset Mysql root or other users password on linux.
MySQL database server version 5.7.5 or older versions
Mysql change root password
Note: MySQL default root password is empty when you installed Mysql or MariaDB.Now, How to reset Mysql root or other users password on linux.
For MySQL 5.7 or above version
Step 1: Open the command terminal.sudo mysql -u rootStep 2: select the database.
use mysql;Step 3: Change the root password.
UPDATE mysql.user SET authentication_string=PASSWORD('YOUR_NEW_PASSWORD') WHERE USER='root';
FLUSH PRIVILEGES;
exit
For MySQL 5.7 version or older version
Step 1: Open the command terminal.sudo mysql -u rootStep 2: select the database.
use mysql;Step 3: To change the MySQL root user password.
update user set password=PASSWORD("YOUR_NEW_PASSWORD") where User='root';Step 4: restart the MySQL service
FLUSH PRIVILEGES;
exit
systemctl restart mysql
MySQL command to change a user password
MySQL show usersSELECT User FROM mysql.user;Step 1: Open the command terminal
sudo mysql -u root -pStep 2: Switch to MySQL database
use mysql;Step 3: Change the USER password
MySQL database server version 5.7.5 or older versions
SET PASSWORD FOR 'YOUR_USER_NAME'@'localhost' = PASSWORD('NEW_PASSWORD');MySQL database server version 5.7.6 or above.
ALTER USER 'YOUR_USER_NAME'@'localhost' IDENTIFIED BY 'NEW_PASSWORD';
Comments
Post a Comment