怎样安装MySQL


下载链接:

 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 
使用随机密码

查看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


文章作者:
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 !
 上一篇
Java常用类和异常 Java常用类和异常
Java常用类及异常处理1. 获取随机数//1.调用Math类中的random()方法 double d1 = Math.random(); //如果需要[0-10.0)的随机数,将d1*10即可 int i = (int)(d1*10);
2020-10-25
本篇 
怎样安装MySQL 怎样安装MySQL
下载链接: https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.31-1.el7.x86_64.rpm-bundle.tar https://cdn.mysql.com//Down
2020-09-06
  目录