Centos7安装MySQL8.0.23

本文详细记录了如何手动安装MariaDB社区版,包括客户端、服务器和相关依赖,并演示了初始化、权限设置、防火墙规则调整及iptables配置。最后展示了如何启用和禁用Firewalld服务以及设置开放的数据库端口。
摘要由CSDN通过智能技术生成

rpm -qa | grep mariadb

rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps
rpm -qa | grep mariadb
cd /usr/local/
mkdir mysql

rpm -ivh mysql-community-common-8.0.23-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-libs-8.0.23-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-client-8.0.23-1.el7.x86_64.rpm --nodeps --force
rpm -ivh mysql-community-server-8.0.23-1.el7.x86_64.rpm --nodeps --force
mysqld --initialize
chown mysql:mysql /var/lib/mysql -R
systemctl start mysqld
systemctl status mysqld
cat /var/log/mysqld.log | grep password

mysql -u root -p
alter user “root”@“localhost” identified by “root”;
exit
mysql -u root -p
create user ‘root’@’%’ identified with mysql_native_password by ‘root’;
grant all privileges on . to ‘root’@’%’ with grant option;
flush privileges;
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘root’ PASSWORD EXPIRE NEVER;
flush privileges;
exit

systemctl stop firewalld.service;
systemctl disable firewalld.service;
systemctl mask firewalld.service;
yum -y install iptables-services
systemctl enable iptables;
systemctl start iptables; vim /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8090 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3307 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4369 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 15672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5672 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8091 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8083 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4379 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10000 -j ACCEPT

systemctl restart iptables.service

systemctl enable iptables.service
systemctl stop iptables.service

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值