Mariadb数据库
安装Mariadb数据库
配置和管理数据库 配置数据库用户和访问权限
备份和恢复数据库
1.Mariadb安装
> yum install mariadb-server -y ####下载数据库软件
> systemctl start mariadb #####开启服务
> mysql ####进入到数据库中
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.35-MariaDB MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> quit
Bye
> netstat -antlpe | grep mysql ####查看mysql端口情况
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 27 76495 3536/mysqld
> vim /etc/my.cnf #####编写配置文件,屏蔽网络接口
[root@mariadb ~]# systemctl restart mariadb
[root@mariadb ~]# netstat -antlpe | grep mysql #####查看mysql服务
[root@mariadb ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.35-MariaDB MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> quit
Bye
> mysql_secure_installation ###安全初始化
Set root password? [Y/n] Y #####设置root用户密码
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
Remove anonymous users? [Y/n] Y #####删除匿名用户
... Success!
Disallow root login remotely? [Y/n] Y #####不允许远程用户登录
... Success!
Remove test database and access to it? [Y/n] Y ######删除测试数据库