Home > Database > Mysql Tutorial > mysql数据库root密码忘了怎么办_MySQL

mysql数据库root密码忘了怎么办_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:45:41
Original
1159 people have browsed it

bitsCN.com

一、以系统的root用户登陆系统,进入终端

  [root@localhost /]#

二、杀掉mysql进程

  方法1、[root@localhost /]#killall mysqld

  方法2、[root@localhost /]#ps -aux //查看所有进程,找到mysql进程的pid

  然后

  [root@localhost /]#kill pid //pid是mysql的进程号

三、用--skip-grant-tables参数启动mysqld

  [root@localhost /]#/usr/local/mysql/bin/mysqld_safe --skip-grant-tables&

  // 其中/usr..../bin是我的mysql安装目录

  

       [root@localhost /]#/usr/local/mysql/bin/mysql          //进入mysql

  mysql> use mysql                                                 //切换到mysql database

  mysql> UPDATE user SET password=password('123456') WHERE user='root';

  //将root密码该为123456了

bitsCN.com
Related labels:
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