Home > Database > Mysql Tutorial > 修改mysql密码与忘记mysql密码的处理方法_MySQL

修改mysql密码与忘记mysql密码的处理方法_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:30:42
Original
1083 people have browsed it

bitsCN.com

修改mysql密码与忘记mysql密码的处理方法

 

修改MySQL密码: 

1mysqladmin -u root -p password 1234562mysqladmin -u用户名 -p旧密码 password 新密码
Copy after login

忘记MySQL密码:

01chown -R mysql:mysql /var/lib/mysql02 /etc/init.d/mysql stop 或 kill -9 杀死进程。03[root@corshetlpro01 bin]# cd /usr/local/mysql/bin04./mysqld_safe --user=mysql --skip-grant-tables --skip-networking &05[root@corshetlpro01 bin]# ps -ef | grep mysql06root     26544 25356  0 15:08 pts/18   00:00:00 /bin/sh ./mysqld_safe --user=mysql --skip-grant-tables --skip-networking07mysql    26673 26544  0 15:08 pts/18   00:00:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=mysql --skip-grant-tables --skip-networking --log-error=/var/lib/mysql/corshetlpro01.err --pid-file=/var/lib/mysql/corshetlpro01.pid --socket=/tmp/mysql.sock --port=330608root     27223 25356  0 15:08 pts/18   00:00:00 grep mysql09./mysql -u root10mysql> use mysql;11mysql> update user set password=password(&#39;newpassword&#39;) where user=&#39;root&#39;;12mysql> flush privileges;13mysql> quit14# /etc/init.d/mysql restart15# mysql -uroot -p16enter password: <输入新设的密码newpassword>
Copy after login

 

 

bitsCN.com
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