User Tools

Site Tools


mysql:change_passwords

MySQL - Change passwords

Change root password

mysql> use mysql;
mysql> update user set password=password("new-password") where user = "root";
mysql> flush privileges;

You may accomplish the same task with mysqladmin MySQL command.

$ mysqladmin -u root password 'new-password'

If you wish to change existing root password, you'll use the following command instead. When entered, you'll be prompted for current root password.

$ mysqladmin -u root -p password 'new-password'

NOTE: You do not have to run “flush privileges” MySQL command to reload the privileges when you use “mysqladmin” command.

mysql/change_passwords.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki