ubuntu下mysql忘记密码

Ubuntu 16.04.1 LTS
mysql5.7.17
试过网上很多方法都不行
能够卸载重装或修改密码的方案求大牛抛出

http://jingyan.baidu.com/article/454316ab4e9e65f7a7c03ad1.html,linux系统也类似吧

修改mysql配置跳过密码认证。然后mysql进去,use mysql,执行修改密码命令即可。

  1. Stop the MySQL Server.
    sudo /etc/init.d/mysql stop

  2. Start the mysqld configuration.
    sudo mysqld --skip-grant-tables &

  3. Login to MySQL as root.
    mysql -u root mysql

  4. Replace YOURNEWPASSWORD with your new password!(注意下述命令尾部有分号)
    UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
    FLUSH PRIVILEGES;
    exit;

MySQL密码忘了怎么办
ubuntu操作系统, apt-get安装的MySQL , 下面链接有两种方法可以解决

 http://form1.cn/database-mysql-117.html

使用mysqladmin命令来修改mysql的root密码

 http://form1.cn/database-mysql-116.html