Change password:
1 - mysqladmin -u root -p [old password] password [new password]
Example: #mysqladmin -u root -p 111111 password 123456
2 - change the data in the table "user" on the database "mysql"
#mysql -uroot -pxxx mysql
mysql>update user set password=password('new password') where user='user';;
mysql>flush privileges;
忘记mysql的root密码:
1、结束mysql进程
2、使用参数skip-grant-tables启动mysqlmysqld -u root --skip-grant-tables &
3、登录mysql修改密码
connect to MySQL
# mysql -u [user] -p[password]
mysql>use [database]; //use which database
mysql>show databases; //show all the database name
mysql>show tables; //show all the table name
mysql>desc user; //show table's structure
阅读(1073) | 评论(0) | 转发(0) |