Home > Database > Mysql Tutorial > body text

mysql忘记密码怎么办(root密码忘记了)

WBOY
Release: 2016-06-07 16:33:08
Original
1556 people have browsed it

我就是个糊涂神,mysql的root密码居然被我忘记了。好惨烈啊,我怎么能够把密码忘掉呢,你是否也遇见同样的问题呢。忘记mysql密码的同学看过来咯。 停止mysql运行,在linux环境下 [shell]/etc/init.d/mysqld stop?[/shell] 修改mysql配置文件my.cnf,添加skip

我就是个糊涂神,mysql的root密码居然被我忘记了。好惨烈啊,我怎么能够把密码忘掉呢,你是否也遇见同样的问题呢。忘记mysql密码的同学看过来咯。

  1. 停止mysql运行,在linux环境下
  2. [shell]/etc/init.d/mysqld stop?[/shell]

  3. 修改mysql配置文件my.cnf,添加skip-grant-tables
  4. 重新启动mysql
  5. [shell]/etc/init.d/mysqld start?[/shell]

  6. 进入mysql数据库,更新root密码
  7. [shell]?mysql -uroot
    use mysql;
    update user set password=password(“letterforu”) where user=”root” [/shell]

  8. 重新启动mysql
  9. [shell]/etc/init.d/mysqld restart[/shell]

一定要吸取教训,刚把这些写完,结果没保存下来,没事就得更新下。不要做糊涂神,把密码记住吧。我曾经想做mysql管理员来着,现在都把mysql密码忘记了,看来数据库管理员这个职业离我还灰常灰常的远。

声明: 本文 ” mysql忘记密码怎么办(root密码忘记了)” 采用 BY-NC-SA 协议进行授权.

转载请注明本文链接地址: http://blog.ueder.info/367.html

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