How To : Install MySql 8 di Ubuntu
MySQL merupakan database open source yang populer. Pada tutorial kali ini kita akan mencoba install MySQL 8 di ubuntu terbaru yaitu ubuntu 18.04. MySQL 8 merupakan MySQL versi terbaru saat ini, dan dinyatakan 2 kali lebih cepat dibandingkan MySQL versi 5.7. Sementara pada ubuntu 18.04 masih menggunakan MySQL 5.7.
Berikut ini fitur terbaru atau improvement yang saya dapatkan dari web mysql.com :
- New! Document Store for developing both SQL and NoSQL document applications using a single database.
- New! Transactional Data Dictionary implemented as a set of SQL tables stored in a single InnoDB tablespace.
- New! SQL Roles for granting and denying permissions to groups of users, greatly reducing the security workload.
- New! Default to utf8mb4 character set for richer mobile applications and international character sets.
- New! Common Table Expressions also known as WITH queries have been added to MySQL 8.0.
- New! Window Functions to reduce code complexity and help developers be more productive.
- New! Invisible Indexes to better manage software upgrades and database changes for applications that run 24×7.
- New! Descending Indexes to eliminate the need for sorting results and leads to performance improvements.
- Improved! JSON Support with numerous additions including the JSON_TABLE() function which accepts JSON data and returns it as a relational table.
- Improved! Up to 2x faster and sets new benchmarks records with upto 1.8 Million Queries/Second.
- Improved! OpenSSL as the default TLS/SSL library in MySQL.
- Improved! Performance Schema with queries that are up to 30x faster.
- Improved! Information Schema with queries that are up to 100x faster.
- Improved! GIS is enhanced to support geography and Spatial Reference Systems (SRS).
- Improved! Replication and InnoDB Cluster for better scale out of high volume applications.
- Reliability requiring little or no intervention to achieve continuous uptime.
- Ease of use with “3 minutes from download to development” installation and configuration.
- Low administration with very little database maintenance required.
- Replication providing flexible topologies for scale-out and high availability.
- Partitioning to improve performance and management of very large database environments.
- ACID Transactions to build reliable and secure business critical applications.
- Stored Procedures to improve developer productivity.
- Triggers to enforce complex business rules at the database level.
- Views to ensure sensitive information is not compromised.
Langkah-langkah
Tambahkan apt repository milik MySQL
download terlebih dahulu package deb yang akan menginstall repository MySQL ke daftar repository ubuntu.
$ wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.10-1_all.deb
Lalu install menggunakan perintak dpkg -i
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
Awal proses instalasi tersebut, akan muncul pertanyaan MySQL dan komponen yang diinstall. Pilih OK, secara default akan meng-install MySQL 8.
Instalasi
Jalankan sudo apt-get update untuk mendapatkan list repository terbaru
sudo apt update
Lalu jalankan install mysql-server
sudo apt-get install mysql-server
Pada proses instalasi, akan ditanyakan password user root yang akan digunakan. Lanjutkan tekan Enter
Selanjutnya, akan ada pesan konfigurasi yang menyatakan bahwa MySQL 8 menggunakan autentikasi SHA256 yang sudah dikembangkan lagi.
Selanjutnya, akan ada pilihan jenis autentikasi yang akan digunakan. Pilih yang diinginkan dan tekan OK.
Mengamankan MySQL Server
Sampai disini sebenarnya instalasi sudah berhasil. Namun secara default instalasi MySQL belum aman. Untuk mengamankannya dengan menjalankan perintah :
sudo mysql_secure_installation
makan pada proses instalasi akan menampilkan beberapa pertanyaan :
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Launch the script by issuing the following command
All done. Untuk memastikan status mysql dengan menjalankan
sudo systemctl status mysql