> For the complete documentation index, see [llms.txt](https://supportx.gitbook.io/buku-mantra-and-sihir/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://supportx.gitbook.io/buku-mantra-and-sihir/trik-sihir/centos-7/install-mariadb-10.4-di-centos-7.md).

# Install Mariadb 10.4 di CentOS 7

{% hint style="warning" %}
Dalam penginstalan CentOS 7 with GUI dan MariaDB Database Server sudah terinstall di dalamnya dengan Mysql/MariaDB `Server version: 5.5.60-MariaDB MariaDB Server`
{% endhint %}

## Buat MariaDB Yum Repository

### Buat file repository&#x20;

```bash
vi /etc/yum.repos.d/MariaDB.repo
```

Tambahkan baris berikut ke dalam `MariaDB.repo` di terminal anda

```
[mariadb]
name = MariaDB
baseurl = https://download.nus.edu.sg/mirror/mariadb/yum/10.4/centos/$releasever/$basearch
module_hotfixes = 1
gpgkey = https://download.nus.edu.sg/mirror/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
```

Atau download file [<mark style="color:purple;">MariaDB.repo</mark>](https://drive.google.com/file/d/15Zzv0Jays7bkYnJXlP6d-mVJW_KrsocU/view?usp=drive_link) dan copy paste file tersebut ke directory `/etc/yum.repos.d`

## Install MariaDB di CentOS 7

### Jalankan perintah berikut untuk memulai install MariaDB

```bash
sudo yum install MariaDB-server MariaDB-client
```

### Setelah install selesai, start dan enable service database server

```bash
systemctl start mariadb

systemctl enable mariadb

systemctl status mariadb
```

## Secure MariaDB CentOS 7

```bash
mariadb-secure-installation
```

<figure><img src="https://1731165174-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtQJu2Q0LuwmDBRrVlRsJ%2Fuploads%2FJJ9xoup6N4XG1ucNQApU%2Fimage.png?alt=media&amp;token=32975ecc-8125-4dc8-8893-8716f7913096" alt="" width="482"><figcaption><p>secure mariadb di centos 7</p></figcaption></figure>

## Menjalankan MariaDB di CentOS 7

### Jalankan service MySQL

```bash
systemctl enable mariadb

systemctl start mariadb
```

### Buat User Remote

Masuk ke dalam shell MariaDB, dengan perintah berikut

```shell
mariadb
```

Selanjutnya buat user remote

{% code title="MariaDB \[(none)]>" %}

```
create user 'root'@'%' identified by 'password';

grant all privileges on *.* to 'root'@'%' with grant option;

flush privileges;
```

{% endcode %}
