Instalasi dan Konfigurasi MySQL di Debian 9
Dengan dirilisnya Debian 9 Stretch, MySQL yang notabene ialah sistem manajemen basis informasi relasional open source sangat terkenal di dunia ini tidak lagi ada di repositori Debian. Selaku pengganti MySQL, debian sudah menyematkan MariaDB jadi sistem basis informasi default.
MariaDB merupakan pengganti MySQL biner drop- in yang kompatibel di seluruh sistem serta sangat ringan. Bila Kamu mau mengubah MariaDB dengan MySQL, lanjutkan buat membaca Bimbingan ini.
Dalam bimbingan ini, kami hendak menampilkan kepada Kamu metode menginstal serta mengamankan MySQL pada mesin Debian 9 dari Repository Apt MySQL. Bila aplikasi Kamu tidak mempunyai persyaratan spesial, Kamu wajib senantiasa memakai MariaDB, sistem database default di Debian 9.
Prasyarat
Saat sebelum melanjutkan bimbingan ini, yakinkan Kamu masuk selaku pengguna dengan hak istimewa sudo.
Langkah 1: Konfigurasi Repository MySQL
Buat meningkatkan repositori MySQL APT ke sistem Kamu, buka taman unduh repositori serta download paket luncurkan terkini memakai perintah wget berikut:
wget http://repo.mysql.com/mysql-apt-config_0.8.10-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.10-1_all.deb
Langkah 2: Instal MySQL
sudo apt update
setelah itu install mysql
sudo apt install mysql-server
Installer hendak memohon Kamu buat mengendalikan kata sandi root MySQL. Jangan set kata sandi saat ini( perkenankan kosong), kita hendak melaksanakannya di bagian berikutnya.
Berikutnya, Kamu hendak disajikan pesan yang berikan ketahui Kamu tentang otentikasi MySQL 8 yang baru. Saat sebelum memilah plugin otentikasi MySQL 8 default, yakinkan plugin tersebut didukung oleh aplikasi Kamu.
Langkah 3: Verifikasi instalasi MySQL
Sehabis instalasi berakhir, layanan MySQL hendak mulai secara otomatis.
Kita bisa mengecek status layanan MySQL dengan mengetik:
sudo systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset:
Active: active (running) since Thu 2018-08-02 17:22:18 UTC; 18s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 14797 ExecStartPre=/usr/share/mysql-8.0/mysql-systemd-start pre (co
Main PID: 14832 (mysqld)
Status: "SERVER_OPERATING"
Tasks: 37 (limit: 4915)
CGroup: /system.slice/mysql.service
└─14832 /usr/sbin/mysqld
Langkah 4: Amankan MySQL
Selanjutnya untuk mengamankan mysql anda bisa menjalankan perintah mysql_secure_installation untuk mengatur kata sandi root dan untuk meningkatkan dari mysql:
sudo mysql_secure_installation
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:
disini anda dimintai untuk VALIDATE PASSWORD PLUGIN yang digunakan untuk menguji kata sandi user MySQL.
Ada tingkatan kebijakan validasi kata sandi:
- low (rendah),
- medium (sedang)
- strong (kuat).
silahkan tekan enter.
Please set the password for root here.
New password:
Re-enter new password:
selanjutnya anda mengatur kata sandi untuk pengguna root MySQL.
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL 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? (Press y|Y for Yes, any other key for No) : 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? (Press y|Y for Yes, any other key for No) : y
Success.
All done!
mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 10Server version: 8.0.12 MySQL Community Server - GPLCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
Membuat Database MySQL
CREATE DATABASE new_database;
Query OK, 1 row affected (0.00 sec)
use new_database;
CREATE TABLE kontak (id INT PRIMARY KEY,nama VARCHAR(30),email VARCHAR(30));Query OK, 1 row affected (0.00 sec)
Post a Comment for "Instalasi dan Konfigurasi MySQL di Debian 9"