ubuntu 如何恢复 MYSQL 密码

我已经表演过的是:

sudo /etc/init.d/mysql stop
/usr/sbin/mysqld --skip-grant-tables --skip-networking &

在此之后,我得到:

[Warning] Using unique option prefix key_buffer instead of
key_buffer_size is deprecated and will be removed in a future release.
Please use the full name instead.

150929 11:48:31[Note] /usr/sbin/mysqld (mysqld ....)starting as
process 3633 ...

它没有进一步处理。

该怎么办?





接下来的步骤可能是:

  1. 在终端:

    mysql
    
  2. 在 mysql 外壳中:

    use mysql;
    select user,password,host from user;
    update user set password=password("newpassword") where user=root;
    select user,password,host from user;
    flush tables;
    FLUSH PRIVILEGES;
    quit
    
  3. 在终端:

    kill -15 `pgrep -f 'skip-grant-tables'
    service mysql start
    mysql -u root -p
    
相关文章推荐:
(0)

相关推荐