Cara install MariaDB di CentOS 8

Tutorial cara install MariaDB di CentOS 8, saya merekomendasikan MariaDB sebagai sistem manajemen database karena banyak fitur yang tidak ada pada MySQL versi gratis, dimana fitur-fitur tersebut juga sangat cocok untuk pembelajaran, misalnya replika database dan lain-lain.

Baik, mari kita mulai instalasi database MariaDB versi terbaru di Linux CentOS 8.

Langkah 1 – Tambah repository MariaDB 10.5

Copy-paste kode berikut pada terminal SSH dan tekan Enter

cat <<EOF | tee /etc/yum.repos.d/mariadb.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

Langkah 2 – Install MariaDB

Eksekusi install  MariaDB 10.05

dnf install MariaDB-server

Jika ada pertanyaan, tekan y dan Enter

Langkah 3 – Start MariaDB

Jalankan service MariaDB

systemctl start mariadb

Langkah 4 – Pengaturan MariaDB

mysql_secure_installation

Setup password untuk root MySQL, dan lainnya

Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
 ... Success!

You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password: ketik password root baru
Re-enter new password: ulangi ketik password root
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!

Langkah 5 – Uji coba membuat database

Coba buat database melalui MySQL console, login sebagai root MySQL

mysql -u root -p

Ketik password root MySQL dan Enter

CREATE DATABASE db_idnettter;
GRANT ALL PRIVILEGES ON db_idnetter.* TO user_idnetter@localhost identified by 'katasandi123';
FLUSH PRIVILEGES;
EXIT;

Langkah 6 – Aktifkan saat boot

systemctl enable mariadb

Selesai teman-teman, semoga bermanfaat.

Add a comment