Home > Database > Mysql Tutorial > body text

ubuntu 11.10 mysql忘记root密码解决_MySQL

WBOY
Release: 2016-06-01 13:36:39
Original
1135 people have browsed it

Ubuntu

bitsCN.com

ubuntu 11.10 mysql忘记root密码解决

 

1、以下在root帐号下执行

 

      # killall mysqld

 

2、然后执行如下命令    

 

     # mysqld   --skip-grant-tables   //在命令行中停止不动

 

3、打开一个新的命令行,然后执行修改root密码的命令

 

    # update user set password=PASSWORD("新的密码")  where  user="root";

 

   # flush privileges;

 

   # exit

 

 4、接着在命令行中就可以使用新的密码登录到mysql了

 

错误提示:    

 

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

此时表示mysql的服务没有起来

 

  执行如下的命令:# /etc/init.d/mysql start               //表示启动mysql

 

                                  #/etc/init.d/mysql  stop               //mysql停止
 

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