一、
mysqladmin -h localhost -u root password "rootpasswd"
mysqladmin -h test.study.com -u root password "rootpasswd"
二、
mysql -u root
mysql>SET PASSWORD FOR = PASSWORD('rootpass')
mysql>SET PASSWORD FOR = PASSWORD('rootpass')
三、
mysql -u root
mysql>use mysql;
mysql>UPDATE user SET Password=PASSWORD('rootpass') WHERE User='root'
mysql>FLUSH PRIVILEGES;
或mysqladmin -u root reload
mysqladmin -u root flush-privileges
删除用户
四、
mysql>USE mysql;
mysql>DELETE FROM user WHERE User = '';
mysql>DELETE FROM db WHERE User= '';
mysql>FLUSH PRIVILEGES;
移除权限
五
mysql>REVOKE ALL ON *.* FROM
mysql>REVOKE GRANT OPTION ON *.* FROM
为匿名用户设置password
mysql>SET PASSWORD FOR = PASSWORD('anonpass');
阅读(861) | 评论(0) | 转发(0) |