欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos7 安装 mysql

程序员文章站 2022-07-14 16:22:34
...
#首先需要安装mariadb-server
yum install -y mariadb-server
#启动服务
systemctl start mariadb.service
#添加到开机启动
systemctl enable mariadb.service

#设置mysql密码
mysqladmin -u root password "17090056"

grant all privileges  on *.* to [email protected]'%' identified by "17090056";

flush privileges;

select host,user,password from user;
#增加 防火墙 放行端口3306
firewall-cmd --zone=public --add-port=3306/tcp --permanent
#
firewall-cmd --reload
#停止firewall
systemctl stop firewalld.service
#禁止firewall开机启动
systemctl disable firewalld.service
相关标签: mariadb