下载包
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar
解压包
mkdir mysql-5.7.36
tar xvf mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar -C mysql-5.7.36
安装包
cd mysql-5.7.36
yum -y install *.rpm
注:依赖perl,需要装下
启动
systemctl start mysqld
systemctl enable mysqld
修改配置文件
cat /etc/my.cnf
[mysql]
default-character-set=utf8mb4
[mysqld]
default-time_zone = '+8:00'
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
max_connections=5000
innodb_buffer_pool_size = 12G
innodb_log_file_size = 1G
innodb_flush_log_at_trx_commit = 1
innodb_write_io_threads = 8
innodb_read_io_threads = 8
lower_case_table_names = 1
symbolic-links = 0
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
查看密码
grep password /var/log/mysqld.log
登录并重新设置密码
set password=password("Ictsoft@123");
授权所有人连接数据库
grant all privileges on *.* to root@'%' identified by 'Ictsoft@123' with grant option;
flush privileges;