LinuxMySQL配置(Mysql 5.7)

下载链接:

 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值