Home > Database > Mysql Tutorial > mysql改动密码

mysql改动密码

WBOY
Release: 2016-06-07 16:15:51
Original
984 people have browsed it

mysql更改密码 1.mysqladmin命令(回目录) 格式如下(其中,USER为用户名,PASSWORD为新密码): mysqladmin -u USER -p password PASSWORD 该命令之后会提示输入原密码,输入正确后即可修改。 例如,设置root用户的密码为123456,则 mysqladmin -u root -p

mysql更改密码
1.mysqladmin命令(回目录)

格式如下(其中,USER为用户名,PASSWORD为新密码):

mysqladmin -u USER -p password PASSWORD

该命令之后会提示输入原密码,输入正确后即可修改。
例如,设置root用户的密码为123456,则

mysqladmin -u root -p password 123456
?
2.UPDATE user 语句(回目录)

这种方式必须是先用root帐户登入mysql,然后执行:

UPDATE user SET password=PASSWORD('123456') WHERE user='root';
FLUSH PRIVILEGES;

?

3.SET PASSWORD 语句(回目录)

这种方式也需要先用root命令登入mysql,然后执行:

SET PASSWORD FOR root=PASSWORD('123456');

?

原文链接:http://www.cnblogs.com/jyginger/archive/2011/04/27/2030017.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template