mysql 如何修改密码

 环境1:windows

1、配置好环境变量,将mysql\bin加入到path中。

2、接着在DOS中直接输入下面命令进行修改(假设原来密码为空)

mysqladmin –uroot  password root

refurl:

http://blog.sina.com.cn/s/blog_53f716d40100kmr8.html

http://www.2cto.com/database/201209/154363.html

http://zhidao.baidu.com/link?url=VR7e3Pj5Pfrpvr-ac3Xsl-JhYX7h6p8wFD0CLrxjpXXfIRGRJC4hZfebf11r2NLfwu709SPDsS8ZO8grZlqj5q

 ps:

1、密码为空的登录方法:

命令中输入命令进行登录mysql,这里假设原密码是空

mysql -uroot -p,然后回车,遇到输入密码界面,直接按回车即可进入系统。

2、密码不为空的登录方法(假设密码是root):

命令中输入:

mysql -uroot -proot

回车即可登录系统,不能在最后加冒号,否则不能登录系统,因为它认为密码是root;了。

 ---------------------------------------------------------------------------------------------------------

环境2:linux(redflag6)+phpmyadmin

连接上phpmyadmin后,点击localhost->SQL,然后输入以下代码,点执行即可:

update user set Password=PASSWORD('Passwor') where User='root';  
flush privileges;

ps:mysql下结束掉mysqld任务的命令:

killall -TERM mysqld

refurl:http://hi.baidu.com/qidusky/item/505655de427847f793a974b7

http://www.linuxidc.com/Linux/2008-02/11137.htm

猜你喜欢

转载自wandejun1012.iteye.com/blog/1964632