Home > Database > Mysql Tutorial > 更改MySQL用户名密码的几种方法归纳

更改MySQL用户名密码的几种方法归纳

WBOY
Release: 2016-06-07 16:55:55
Original
1267 people have browsed it

Method 1:在/usr/local/mysql/bin/下:./mysqladmin -u root password lsquo;new_passwordrsquo;一般安装时用此方法设置。Meth

Method 1:
在/usr/local/mysql/bin/下:
./mysqladmin -u root password ‘new_password’
一般安装时用此方法设置。

Method 2:
在mysql状态下:
mysql>UPDATE user SET password=PASSWORD(’new_password’) WHERE user=’root’;
mysql>FLUSH PRIVILEGES;

Method 3:
mysql>SET PASSWORD FOR root=PASSWORD(’new_password’);

补一下补知道root密码情况下修改root密码
mysqld启动的时候加上–skip-grant-tables,然后马上修改密码,修改后去掉–skip-grant-tables,然后就OK了。

想起了3年前在eyou工作的时候,为了导qmail+vpopmail+mysql的邮件用户出来,修改了root密码,但是当时eyou的系统没有使用,原来的系统因为root密码而不能使用,我就看libvpopmail.a,,从二进制文件中找到了密码:)

linux

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