zoukankan      html  css  js  c++  java
  • ubuntu18.04下mysql 5.7安装时没有出现设置密码提示

      前言:

      一:配置

      系统:ubuntu 18.04 

      软件:mysql 5.7.30

      

      二:问题 

      ubuntu18.04下mysql安装时没有出现密码提示,可能是bug,也许是另有原因。安装后自己有一个默认的用户名以及密码。

      解决方案:

      1. 在终端输入:

    sudo vi /etc/mysql/debian.cnf


    可以查看到:

    user     = debian-sys-maint
    
    
    password = WU2UbLLd4totyAs8

      2. 用该账户登陆mysql:

      注意:这里的密码是上面的{随机密码}

    mysql -u debian-sys-maint -p

      3. 设置root的用户密码:

    update mysql.user set authentication_string=password('123456') where user ='root' and Host='localhost';
    update mysql.user set plugin = 'mysql_native_password';
    flush privileges;
    quit

     

      4. 重启mysql服务:

    sudo /etc/init.d/mysql stop
    sudo /etc/init.d/mysql start

      5. 用root登陆:

    mysql -u root -p

       声明:

       作者:HepengWu

      


    ————————————————------------------------------------------------------------------------------------------

    参考链接:https://blog.csdn.net/Kwoky/article/details/89492074

         https://www.jianshu.com/p/161f612a971c

         

  • 相关阅读:
    分页类
    验证码扭曲类
    model 概念(笔记)
    php单例模式
    php 无限极分类查找家谱树
    数组的合并
    无限极分类之查找子孙树
    android xml中的xliff属性
    android 悬浮覆盖状态栏的相关建议
    【jzoj】20190323比赛总结
  • 原文地址:https://www.cnblogs.com/WLCYSYS/p/12857082.html
Copyright © 2011-2022 走看看