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

修改mysql密码的方法

WBOY
Release: 2016-06-21 09:08:47
Original
811 people have browsed it

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';



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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template