Introduction

MySQL adalah perangkat lunak bebas dan open source dibawah ketentuan GNU General Public License, dan MySQL terkenal akan kecepatan
mudah digunakan, scalable, dan merupakan bagian integral dari LAMP stack dan LEMP stacks yang populer. Dan Mysql ini sendiri adalah
salah satu database yang paling sering digunakan oleh Developer dan berikut Cara Install MySQL di Ubuntu server anda.

Prepare

  • Pastikan Anda masuk sebagai pengguna dengan hak istimewa sudo.

Cara Install MySQL di Ubuntu

Step-1 Install MySQL

Pada saat saya menulis artikel ini, versi terbaru MySQL yang tersedia di repositeri adalah MySQL versi 8.0.23 , dan kita bisa check repository mysql di Link ini.

  • Lakukan update indeks paket apt anda:
$ sudo apt update
  • Kemudian install Paket MySQL anda:
$ sudo apt install mysql-server
  • Setelah instalasi selesai, MySQL akan secara default running otomatis, dan check service tersebut jalan atau tidak dengan ketik :
$ sudo systemctl status mysql

● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-07-02 13:59:45 WIB; 45min ago
   Main PID: 18199 (mysqld)
     Status: "Server is operational"
      Tasks: 39 (limit: 4617)
     Memory: 334.3M
     CGroup: /system.slice/mysql.service
             └─18199 /usr/sbin/mysqld

Jul 02 13:59:44 db-mysql2 systemd[1]: Starting MySQL Community Server...
Jul 02 13:59:45 db-mysql2 systemd[1]: Started MySQL Community Server.

Step 2 – Konfigurasi MySQL

MySQL sendiri dilengkapi dengan script bernama mysql_secure_installation yang dapat melakukan beberapa operation terkait security, dan setelah melakukan instalasi biasanya kita diharuskan untuk melakukan konfigurasi tsb yang memang sangat wajib kita lakukan.

$ sudo mysql_secure_installation

Nantinya kita akan dimina untuk melakukan sedikit konfigurasi terkait VALIDATE PASSWORD PLUGIN yang digunakan untuk testing seberapa kuat password pengguna MySQL untuk meningkatkan keamanan.
Dan juga ada 3 tingkat kebijakan validasi LOW, MEDIUM, HIGH dan lainya.

  • validate password plugin
Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: Y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0

Terlepas dari apakah Anda memilih untuk mengatur Plugin Validasi Kata Sandi, permintaan berikutnya adalah mengatur kata sandi untuk pengguna root MySQL. Masukkan dan kemudian konfirmasikan kata sandi aman pilihan Anda:

Output
Please set the password for root here.


New password: 

Re-enter new password:
  • Yes saja dan lakukan sampai ada outout All Done !
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.

All done!

Step 3 – Login ke mysql

  • Setelah semua nya done selanjutnya adalah testing MySQL anda dengan login menggunakan password yang anda create tadi :
$ sudo mysql -u root -p

Output

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.25-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql>

Finish, Thanks a lot sudah berkunjung mohon kritik & saranya.

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *