安装过程(5.7):

  1. wget https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
  2.  
  3. rpm -ivh mysql57-community-release-el7-10.noarch.rpm
  4.  
  5. rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
  6.  
  7. yum install -y mysql-community-server
  8.  
  9. systemctl start mysqld

修改密码:

  1. grep 'password' /var/log/mysqld.log
  2.  
  3. set global validate_password_policy=LOW;
  4. set global validate_password_length=4;
  5.  
  6. ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

修改配置:vi /etc/my.cnf

  1. [client]
  2. default-character-set=utf8
  3.  
  4. [mysqld]
  5. character-set-server=utf8
  6. collation-server=utf8_general_ci