MYSQL密码设置

当MYSQL安装成功后,root用户的密码默认是空的,有三种方式可以重新设置root账号的密码

1.用root 进入mysql后
mysql>set password =password('你的密码');
mysql>flush privileges;//刷新MYSQL系统权限
 
2.使用GRANT语句 
mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ; 
mysql>flush privileges;
 
3.进入mysql库修改user表
mysql>use mysql;
mysql>update user set password=password('你的密码') where user='root'; 
mysql>flush privileges;
posted @ 2014-10-16 19:42  向着太阳生  阅读(134)  评论(0编辑  收藏  举报