首先在源里面增加
源地址 https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/
然后使用添加进去
vim CentOS-Base.repo
#Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
yum install mysql-community-server
一键安装
安装完mysql 已经有默认密码 就要去查看mysql的日志啦
vim /var/log/mysqld.log
然后设置密码
set global validate_password_policy=LOW;
set global validate_password_length=4;
set global validate_password_policy=0;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; 设置密码
给予外网外网连接权限
update user set host='%' where user='root';
flush privileges;