mysql忘记root密码后怎么办理?linux第二种方法 - 小施Blog - 凡走过,必留下痕迹.
1>首先kill后台进程(not kill -9)。每次mysqld重启的时候都会在系统目录下生成一个hostname.pid的文件。里面记录这mysqld进程的pid(进程号)。
   #kill mysqld.pid (使用root用户!hostname是系统的主机名)    或 #/etc/init.d/mysqld stop

2>使用--skip-grant-tables选项来重新启动mysqld
#/usr/bin/mysqld_safe --skip-grant-tables &

3>使用mysql用户登录到mysqld服务器上进行相关授权操作,并重新载入权限。
#mysql -h hostname mysql
mysql>use mysql;
mysql>update user set password=password("new password") where user="root";
mysql>flush privileges;


4>#kill -TERM mysqld,重新启动mysql服务
Tags: , ,
学习笔记 » Mysql相关 | 评论(0) | 引用(0) | 阅读(566)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写