Ubuntu18.04安装MySQL

  1. 使用Ubuntu自带包管理器安装

    sudo apt install mysql-server
  2. 新版本安装过程中没有提示设置root用户密码,根据安装日志和[官方文档]

    (https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html)

    If you used –initialize-insecure to initialize the data directory, connect to the server as root without a password:

    sudo mysql -u root --skip-password
  3. 登录之后,设置root用户密码:

    mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
    
阅读更多
换一批

没有更多推荐了,返回首页