# yum命令安装mariadb



### 环境

* 1、操作系统CentOS 7.6 64bit（可连外网）
* 2、使用命令 yum

### 安装步骤

1、安装mariadb-server, mariadb

```bash
yum -y install mariadb mariadb-server
##ubuntu18.04下安装mariaDB
   # apt-get install mariadb-server
   # apt-get install mysql-server-5.7
```

2、启动mariadb,开机自启动

```bash
systemctl start mariadb
systemctl enable mariadb
```

**密码、连接、等设置** （按提示操作）输入

```bash
mysql_secure_installation
```

**配置MariaDB允许远程连接的方法**

```bash
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
flush privileges;
```
