分类: 数据库开发技术
2011-08-31 13:16:13
#service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
这样就可以直接登录的,然后重设置密码
#mysql
mysql> SET PASSWORD FOR ‘root’@’host_name’= PASSWORD(‘’);
MySQL密码设置有三种:
# mysqladmin –uroot –hlocalhost password ‘redhat’
mysql> SET PASSWORD FOR ‘root’@’host_name’= PASSWORD(‘’);
mysql > UPDATE mysql.user SET Password=PASSW(‘REDHAT’ WHERE User=’root’ and Host=’127.0.0.1’;