美文网首页
ubuntu 安装mysql

ubuntu 安装mysql

作者: 阿亚2011 | 来源:发表于2020-05-26 19:26 被阅读0次

    ubuntu安装mysql非常简单,主要安装后要自己找下密码。

    sudo apt install mysql-server
    

    找到密码

    sudo cat /etc/mysql/debian.cnf
    

    显示如下:

    # Automatically generated for Debian scripts. DO NOT TOUCH!
    [client]
    host     = localhost
    user     = debian-sys-maint
    password = RxvvvvviF84DDkfc
    socket   = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host     = localhost
    user     = debian-sys-maint
    password = RxvvvvviF84DDkfc
    socket   = /var/run/mysqld/mysqld.sock
    

    这里得到用户名和密码,登录一下

    mysql -u debian-sys-maint -p RxvvvvviF84DDkfc
    

    然后修改一下密码

    set password for 'debian-sys-maint'@localhost = password('S@#@$123456');
    

    相关文章

      网友评论

          本文标题:ubuntu 安装mysql

          本文链接:https://www.haomeiwen.com/subject/xtnvahtx.html