四、CentOS 安装mariadb——Linux学习笔记
A)安装及配置
- 下载mariadb:
yum -y install mariadb-server mariadb
- 开启mariadb服务:
systemctl start mariadb.service
- 重启:systemctl restart mariadb.service
- 无密码登录mariadb:
mysql
- 查看用户表:
select * from mysql.user;
- 修改密码和授权: grant all on *.* to 'root'@'%' identified by '123456' with grant option;update mysql.user set host = '%' where user = 'root';select host, user from user;flush privileges;
- 密码登录: mysql -u root -p
设置开机启动:systemctl enable mariadb.service
B)防火墙
- 停止防火墙::systemctl stop firewalld
- 安装iptables-services:yum install iptables-services
- 设置开机启动:
systemctl enable iptables
systemctl stop iptables
systemctl start iptables
systemctl restart iptables
systemctl reload iptables
4.保存设置:
service iptables save
5.开放某个端口 在/etc/sysconfig/iptables里添加:
/sbin/iptables -A INPUT -p tcp --dport 3306 -j ACCEPT 或者
查看防火墙状态:
service iptables status
永久性生效,重启后不会复原
开启:
chkconfig iptables on
关闭:
chkconfig iptables off
2.即时生效,重启后复原
开启:
service iptables start
关闭:
service iptables stop
参考
https://www.cnblogs.com/star91/p/4980024.html
https://blog.csdn.net/qq_40342287/article/details/82428048
http://blog.51cto.com/12173069/2119307
https://www.cnblogs.com/wujunbin/p/7465538.html
https://blog.csdn.net/c233728461/article/details/52679558/
https://blog.csdn.net/qq_37928350/article/details/78830896
最新文章
- Oracle---------sql 中取值两列中值最大的一列
- Servlet学习一
- C#如何实现一个简单的流程图设计器
- Python字符串的编码与解码(encode与decode)
- ClipDrawable 实现图片渐变现实
- 【Networking】flannel,pipework,weave,udp,vxlan,ovs等资料
- ABAP遇到的问题——1
- php + mysql 分布式事务(转)
- js中的闭包之我理解
- 关于Struts2的Validator的配置找不到DTD
- Python学习笔记一--字符串的使用
- 技术贴:asp.net实现唯一账户在线 禁止同一帐号同时在线 asp.net实现您的帐号在别处登录,您已被迫下线!
- 了解各种AA特性
- Angular JS的正确打开姿势——简单实用(下)
- spring boot RESTFul API拦截 以及Filter和interceptor 、Aspect区别
- Keras入门(一)搭建深度神经网络(DNN)解决多分类问题
- Codeforces Round #524 (Div. 2) C. Masha and two friends 几何:判断矩形是否相交以及相交矩形坐标
- 多模块项目提示“Module ** must not contain source root **. The root already belongs to module **”的解决办法
- vue深入了解组件——处理边界情况
- Codeforces 677C. Coloring Trees dp