Home  >  Article  >  php教程  >  修改mysql密码的方法

修改mysql密码的方法

WBOY
WBOYOriginal
2016-06-21 09:08:47694browse

mysql

修改mysql密码的方法

use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;

1.通过修改MYSQL数据库中MYSQL库的USER表
       就用普通的UPDATE、INSERT语句就可以

2.在命令行中使用如下命令
       MYSQLADMIN -u root -p PASSWORD mypasswd

3.可以修改MYSQL文件夹中的MY.INI文件

4.使用SET PASSWORD语句,
mysql> SET PASSWORD FOR myuser@localhost = PASSWORD('mypasswd');

5.使用GRANT ... IDENTIFIED BY语句
mysql> GRANT USAGE ON *.* TO myuser@localhost IDENTIFIED BY 'mypassword';



Statement:
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