Home > Database > Mysql Tutorial > MYSQL5重置root密码_MySQL

MYSQL5重置root密码_MySQL

WBOY
Release: 2016-05-27 14:29:31
Original
1121 people have browsed it

bitsCN.com     操作系统:DEBIAN Linux 3.1
MYSQL数据库版本:5.0.27
(1)以 系统root权限登陆
(2)停止MYSQL服务器:
          mysql.server 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服务器,用正常方试起动
  如果您用的不是我这个版本,可以在mysql的安装目录中找一个适合您当前版本的mysqld_safe,后面加上--skip-grant-tables来跳过授权表,我书上所用的mysqld_safe版本为 "safe_mysqld"(其实写到这里我好像想起来了,在哪看到过说5.0以后把sqfe_mysqld改成mysqld_safe了,这害得我在网上找了半天)bitsCN.com

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template