《Mysql应用Centos下修改mysql密码》要点:
本文介绍了Mysql应用Centos下修改mysql密码,希望对您有用。如果有疑问,可以联系我们。
导读:Centos下修改mysql密码教程分享给大家.
1.修改MySQL的登录设置:
# vim /etc/my.cnf
加上一句:skip-grant-tables
如:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
2.重启mysql
# service mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
3.修改密码
mysql> USE mysql ;
Database changed
mysql> UPDATE user SET Password = password ( '新密码' ) WHERE User = 'root' ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
mysql> flush privileges ;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
4.修改刚刚改过的配置文件
# vim /etc/my.cnf
5.重启mysql
# service mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
转载请注明本页网址:
http://www.vephp.com/jiaocheng/5753.html