多种修改MySQL密码的方法
1: excute command SET PASSWORD
MySQL -u root
MySQL的> 为“ root” @“ localhost”设置密码’ =密码(“新通行证”);
2:mysqladmin
mysqladmin -u root password “新通”
You can excute the following command if root password had been set.
mysqladmin -u root password oldpass “新通”
3: UPDATE user table
mysql -u root
MySQL的> 使用mysql;
MySQL的> UPDATE user SET Password = PASSWORD(“新通行证”) WHERE user = ‘root’;
MySQL的> FLUSH PRIVILEGES;
You can also take the following action if root password lost.
mysqld_safe –跳过拨款表&
mysql -u root mysql
MySQL的> UPDATE user SET password=PASSWORD(“new password”) WHERE user=’root’;
MySQL的> FLUSH PRIVILEGES;