mariadb服务端配置:
(1)安装mysql服务
yum installmariadb-server
(2)为了方便管理数据库中的表文件,建议在/etc/my.cnf增设如下
[mysqld]中添加:
innodb_file_per_table = on表为单独文件方便管理
skip_name_resolve = on 禁止主机名解析 加速访问
(3)启动服务,执行安全安装操作
systemctl start mariadb
(4)查看监听端口,3306为mariaDB的默认监听端口
ss -tnl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 50 *:3306 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 128 :::22 :::*
(5)执行安全安装操作
mysql_secure_installation
Set rootpassword? [Y/n] y # 设置管理员登陆秘密(此密码和linux系统的root没关系)
Newpassword:
Re-enter newpassword: # 输入密码即可
Passwordupdated successfully!
Reloadingprivilege tables..
...Success!
Removeanonymous users? [Y/n] y # 是否移除匿名用户(在执行安全安装之前不需要密码登陆)
...Success! #允许匿名登陆时很危险的,建议移除
Disallow rootlogin remotely? [Y/n] n # 是否不允许管理员账号远程登陆,一般情况下建议不允许
...skipping.
Remove testdatabase and access to it? [Y/n] y # 移除测试数据库
-Dropping test dat