Linux-mysql5.7安装过程

Centos7

1、查看是否安装mysql

yum search mysql

未看到:mysql-community-server.x86_64

2、下载mysql源

wget http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

3、查看是否安装mysql源

yum repolist enabled | grep "mysql.*"
mysql-connectors-community/x86_64 MySQL Connectors Community                 165
mysql-tools-community/x86_64      MySQL Tools Community                      115
mysql57-community/x86_64          MySQL 5.7 Community Server                 444

yum search mysql
...
mysql-community-server.x86_64 : A very fast and reliable SQL database server
...

安装源
yum localinstall mysql57-community-release-el7-10.noarch.rpm

4、安装mysql

yum install mysql-community-server

5、查看mysql版本

mysql -V
mysql  Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using  EditLine wrapper

6、启动和配置参考: Linux-mysql5.8安装过程

因为安装了Yum Repository,以后每次yum操作都会自动更新,需要把这个卸载掉:

yum -y remove mysql57-community-release-el7-10.noarch

设置权限

set password=password('123456');
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
set global validate_password_policy=0;
set global validate_password_length=1;
set password=password('123456');

grant all on *.* to root@'%' identified by '123456';
flush privileges;

7、防火墙设置

systemctl status firewalld
systemctl start firewalld
systemctl status firewalld

防火墙需要开放 3306 端口,依次执行:
firewall-cmd --permanent --zone=public --add-port=3306/tcp
firewall-cmd --permanent --zone=public --add-port=3306/udp
firewall-cmd --reload

如果是 CentOS 7,需要将 MySQL 服务加入防火墙,然后重启防火墙:
firewall-cmd --zone=public --permanent --add-service=mysql
firewall-cmd --reload #重载防火墙配置 或 systemctl restart firewalld 重启防火墙

8、本地远程连接到阿里云服务器,出现如下问题:

阿里云服务器设置,【防火墙】-【添加规则】

 

 

Centos8

http://www.321332211.com/thread?topicId=352

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值