MYSQL5忘记密码后重置root密码

系统:DEBIAN etch 4.0

MYSQL数 据库版本:5.0.27

(1)以 系统root权限登陆

(2)停止MYSQL服务器:
/etc/init.d/mysql stop

(3)跳过授权表执行MYSQL服务器:
mysqld_safe --skip-grant-tables --skip-networking &
(注:参数--skip-grant-tables为跳过授权表;--skip-networking为不监听TCP/IP连接)

(4)执行MYSQL客户端:
mysql

(5)使用mysql数据库
use mysql;

(6)更新root密码
update user set password=password('新密码') where user='root';

(7)关闭mysql服务器,用正常方试起动
/etc/init.d/mysql restart

Last modified onSaturday, 05 January 2013 13:21

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169
  • Published in 主机
  • Read 3644 times

Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478
back to top