下载命令:
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum -y install mysql-server
systemctl start mysqld
systemctl status mysqld
grep ‘temporary password’ /var/log/mysqld.log
mysql -u root -p(此处不用输入密码,按下回车后会专门要你再输入密码的)
vi /etc/my.cnf # 修改之前记得备份
default-storage-engine=INNODB
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_file_format=Barracuda
innodb_log_file_size=2G
sql_mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
修改之后重启 systemctl restart mysqld