日期:2014-05-16 浏览次数:20738 次
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
skip-grant-tables #添加这句话,这时候登入mysql就不需要密码
symbolic-links=0
[root@sample ~]# /etc/init.d/mysqld start 启动mysql服务
[root@sample ~]# mysql 登入mysql
mysql> USE mysql ;
mysql> UPDATE user SET Password = password(‘new-password‘) WHERE User = ’root’ ;