Install MySQL8 under Linux

1. Download the MySQL version corresponding to the system and upload it to the server to be installed.

MySQL :: Download MySQL Yum Repository

2. Start the installation

  1. Add to yum library
    1. Order:
      #下载    https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
      
      yum install mysql80-community-release-el7-3.noarch.rpm
    2. Check whether the command was added successfully:
      yum repolist enabled | grep "mysql.*-community.*"
  2. Installation command:
     yum install mysql-community-server
    
    # 如果出现 Unable to find a match: mysql-community-server 请先禁用本地组件再安装
    
    yum module disable mysql
    
    yum install mysql-community-server
    
    
    
  3. Check the installation directory and version
  4.  StartMySQL
    systemctl start mysqld

 After successful startup, you need to generate a temporary password to log in and modify and set a new password.

# 生成 root@localhost 的临时密码
grep 'temporary password' /var/log/mysqld.log

 Use temporary password to log in and then change password

 Log out and log in using a new password

Guess you like

Origin blog.csdn.net/weirdo_world/article/details/120722984