分类: Mysql/postgreSQL
2008-05-01 18:24:44
1. 命令行更改: mysqladmin password 新密码 例如, dos(或者liunx)下mysql的bin目录下,mysqladmin password 123456 2. 用MYSQL的grant语句,例如 GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION 3. SET PASSWORD FOR '用户名'@'主机' = PASSWORD('密码') 例如设置root密码为123456,SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123456'); 4. UPDATE user SET Password=PASSWORD('新密码') WHERE User='用户名' AND Host = '主机'; 例如,UPDATE user SET Password=PASSWORD('123456') WHERE User='root' AND Host = 'localhost';flush priviliges; |