下载链接:
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.31-1.el7.x86_64.rpm-bundle.tar
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-server-5.7.27-1.el7.x86_64.rpm
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-client-5.7.27-1.el7.x86_64.rpm
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-libs-5.7.27-1.el7.x86_64.rpm
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-common-5.7.27-1.el7.x86_64.rpm
推荐迅雷下载速度快
yum remove mariadb-libs
yum install mysql* -y
在/etc/my.cnf的[mysqld]中写入
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
default-time-zone = '+8:00'
使用随机密码
查看Mysql随机密码
grep 'temporary password' /var/log/mysqld.log
登录mysql后
show variables like 'validate_password%'; 查看mysql密码策略
set global validate_password_policy=low; 设置low策略
set global validate_password_length=4; 设置密码最低长度为六位
alter user 'root'@'localhost' identified by 'root'; 设置root密码为六位数
grant all on *.* to root@'%' identified by 'root' with grant option;远程登录授权
简洁
set global validate_password_policy=low;
set global validate_password_length=3;
alter user 'root'@'localhost' identified by 'root';
grant all on *.* to root@'%' identified by 'root' with grant option;
set global validate_password_policy=0;
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=1;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
创建MySQL用户
create user 'test'@'%' identified by 'test';
grant all on test.* to 'test'@'%' identified by 'test' with grant option;
flush privileges;
重启mysql
systemctl restart mysqld
systemctl enable mysqld
Windows Mysql5.7Installer:
https://downloads.mysql.com/archives/installer/
mysql用户管理
https://www.cnblogs.com/diantong/p/11024294.html
离线安装配置MySQL
https://github.com/hackeruncle/mysql