Lompat ke konten Lompat ke sidebar Lompat ke footer

Cara Install mariadb & phpmyadmin di Centos 8 Server

Cara Install mariadb & phpmyadmin di Centos 8 Server

Pada kesempatan kali ini saya akan share bagaimana Cara Install mariadb & phpmyadmin di Centos 8 Server. Pada artikel sebelumnya kita sudah melakukan Installasi Web Server menggunakan HTTPD dan kali ini kita akan tambahkan database Mariadb dan Phpmyadmin untuk pengelolaan database secara Webbase.

MariaDB adalah sistem manajemen database relasional yang dikembangkan dari MySQL. MariaDB dikembangkan oleh komunitas pengembang yang sebelumnya berkontribusi untuk database MySQL.

Sedangkan untuk pengelolaan databasenya kita menggunakan PhpMyadmin, dengan menggunakan aplikasi Phpmyadmin, mengelola Database jadi lebih mudah.

Pada tutorial kali ini kita akan belajar cara install dan konfigurasi Database Mariadb dan Installasi Phpmyadmin di centos 8 server. Oke Langsung saja ikuti step by step Tutorial Cara Install mariadb & phpmyadmin di Centos 8 Server.

Peratama kita akan install database mariadb, untuk cara installasinya silahkan jalankan perintah dibawah ini.

[root@srv1 ~]# dnf install -y mariadb-server
Selanjutnya aktifkan Service Mariadb dengan perintah berikut.
[root@srv1 ~]# systemctl start mariadb
[root@srv1 ~]# systemctl enable mariadb
Jangan lupa untuk cek status service mariadb, pastikan service sudah Active dan running
[root@srv1 ~]# systemctl status mariadb
Jalankan perintah Secure Installation untuk membuat password
[root@srv1 ~]# mysql_secure_installation

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): [ENTER]
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: [Masukan password]
Re-enter new password: [Masukan password]
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
Untuk pengetesan silahkan login ke database lalu test buat database
[root@srv1 ~]# mysql -u root -p
Enter password: [Masukan Password]
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 16
Server version: 10.3.17-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database testdatabase;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> show databases;
| Database           |
| information_schema |
| mysql              |
| performance_schema |
| testdatabase       |
4 rows in set (0.001 sec)

MariaDB [(none)]> exit

Cara Install mariadb & phpmyadmin di Centos 8 Server

Install PhpMyAdmin

Langkah selanjutnya Installasi Phpmyadmin, sebelumnya Install paketnya terlebih dahulu
[root@srv1 ~]# dnf install php php-pdo php-pecl-zip php-json php-mbstring php-mysqlnd php-json php-mbstring
Download phpmyadmin dengan perintah berikut
[root@srv1 ~]# wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip
Unzip File phpmyadmin
[root@srv1 ~]# unzip phpMyAdmin-5.0.1-all-languages.zip
[root@srv1 ~]# mv phpMyAdmin-5.0.1-all-languages /usr/share/phpmyadmin
Buat direktori tmp
[root@srv1 ~]# mkdir /usr/share/phpmyadmin/tmp
[root@srv1 ~]# chown -R apache:apache /usr/share/phpmyadmin
[root@srv1 ~]# chmod 777 /usr/share/phpmyadmin/tmp
Konfigurasi phpmyadmin
[root@srv1 ~]# nano /etc/httpd/conf.d/phpmyadmin.conf
Masukan Script dibawah ini
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin/>
   AddDefaultCharset UTF-8
   <IfModule mod_authz_core.c>
     # Apache 2.4
      Require all granted
<Directory /usr/share/phpmyadmin/setup/>
   <IfModule mod_authz_core.c>
 # Apache 2.4
       Require all granted
Simpan perubahan, lalu enable SELinux
[root@srv1 ~]# chcon -Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*
Jangan lupa untuk restart service httpd
[root@srv1 ~]# systemctl restart httpd


Setelah installasi database Mariadb dan PhpMyadmin selesai, selanjutnya kita akan melakukan pengetesan, untuk pengetesan silahkan akses menggunakan dari PC Client dengan menggunakan browser http://IP_Address/phpmyadmin

cara, install, mariadb, dan, phpmyadmin, di, centos, 8, server
Masukan user root lalu masukan password database yang sebelumnya kita buat

cara, install, mariadb, dan, phpmyadmin, di, centos, 8, server

Jika berhasil maka akan masuk ke Dashboard PhpMyadmin.

Mengatasi Pesan Error phpmyadmin

cara, install, mariadb, dan, phpmyadmin, di, centos, 8, server

Error 1
Klik Find out why > Create

Error 2 dan 3
Edit file config.sample.inc.php
[root@srv1 ~]# vim /usr/share/phpmyadmin/config.sample.inc.php

pada baris 18 ganti menjadi
$cfg['blowfish_secret'] = 'qtdRoGmbc9{8IZr323xYcSN]0s)r$9b_JUnb{~Xz'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

pada baris 77 Tambahkan
$cfg['TempDir'] = '/tmp';

Ganti nama file config.sample.inc.php menjadi config.inc.php
[root@srv1 ~]# mv /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

Demikian kira-kira tutorial Cara Install mariadb & phpmyadmin di Centos 8 Server ini saya buat. Semoga bermafaat untuk kita semua. Silahkan Share Jika Kalian merasa postingan ini bermanfaat. Sekian & Terimakasih Salam.

Artikel Selanjutnya : Cara Install MySQL Server & phpmyadmin di Centos 8 Server

Posting Komentar untuk "Cara Install mariadb & phpmyadmin di Centos 8 Server"