If it is just installed successfully, the password is empty, Change Password method: mysqladmin-urootpassword11111 password is not empty, Change Password method there are two: 1) mysqladmin-uroot-p111111password1234562) updatemysql. usersetpasswordPASSWORD (123456) whereuserroot #
If the password is blank after the installation is successful, the password can be changed to mysqladmin-u root password '000000'. There are two ways to change the password: 1) mysqladmin-u root-p '000000' password '000000' 2) update mysql. user set password = PASSWORD ('000000') where user = 'root '#
If the password is blank after the installation is successful, change the password as follows:
Mysqladmin-u root password '123'
The password is not blank. There are two methods to change the password:
1)
Mysqladmin-u root-p '000000' password '000000'
2)
Update mysql. user set password = PASSWORD ('000000') where user = 'root'
# Be sure to refresh the permission
Flush privileges;
Remedy for forgetting the root password
Single Instance:
Killall mysqld
Mysqld_safe -- skip-grant-tables & # Start
Mysql-u root-p
Or
Add a row in my. cnf [mysqld]
Skip-grant-tables
Multiple instances:
Killall mysqld
Mysqld_safe -- defaults-file =/data/3306/my. cnf -- skip-grant-table &
Mysql-u root-p-S/data/3306/mysql. sock
Change Password:
Update mysql. user set password = PASSWORD ('oldboys') where user = 'root ';
Flush privileges;
Restart the test after modification:
Killall mysqld
Single Instance:/etc/init. d/mysqd restart
Multi-instance:/data/3306/mysql restart
[Author] Zeng jiansheng
[Author mailbox] zengjiansheng1@126.com
[Author's QQ] 190678908
[Author's blog] blog.csdn.net/newjueqi