Difference between revisions of "IPv6 Database: MySQL Server"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "Instalasi dengan menggunakan perintah # apt-get update # apt-get -y install mysql-server mysql-client Agar lebih aman lakukan secure installation # mysql_secure_installa...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Instalasi dengan menggunakan perintah
 
Instalasi dengan menggunakan perintah
  
  # apt-get update
+
  apt update
  # apt-get -y install mysql-server mysql-client
+
  apt -y install mysql-server mysql-client
  
Agar lebih aman lakukan secure installation
+
Restart MySQL Server
  
  # mysql_secure_installation
+
  /etc/init.d/mysql restart
 
 
Jawab “Y” untuk banyak pertanyaan berikut
 
 
 
  Enter current password for root (enter for none):
 
  OK, successfully used password, moving on...
 
  Change the root password? [Y/n] n
 
  ... skipping.
 
  Remove anonymous users? [Y/n]
 
  ... Success!
 
  Disallow root login remotely? [Y/n] Y
 
  ... Success!
 
  Remove test database and access to it? [Y/n] Y
 
  ... Success!
 
  Reload privilege tables now? [Y/n] Y
 
  ... Success!
 
  
Edit Konfigurasi MySQL agar bisa di sambung dari IPv4 dan IPv6
+
Untuk test IPv6. Edit
  
  vi /etc/mysql/my.cnf
+
  vi /etc/hosts
  
Pastikan
+
Edit
  
  bind-address            = ::
+
  ::1    localhost
 +
::1    localhost6
  
Restart MySQL Server
+
Test sambungan MySQL ke localhost (localhost) dengan IPv6
 
 
/etc/init.d/mysql restart
 
 
 
Test sambungan MySQL ke localhost (::1) dengan IPv6
 
  
 
  mysql -u root -h ::1 -p123456  
 
  mysql -u root -h ::1 -p123456  
Line 41: Line 23:
 
Jika berhasil maka akan keluar kira-kira:
 
Jika berhasil maka akan keluar kira-kira:
  
  Welcome to the MySQL monitor.  Commands end with ; or \g.  
+
mysql: [Warning] Using a password on the command line interface can be insecure.
  Your MySQL connection id is 37
+
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Server version: 5.5.35-1ubuntu1 (Ubuntu)  
+
  Your MySQL connection id is 5
 +
  Server version: 5.7.25-0ubuntu0.18.04.2 (Ubuntu)
 
   
 
   
  Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.  
+
  Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
 
   
 
   
  Oracle is a registered trademark of Oracle Corporation and/or its  
+
  Oracle is a registered trademark of Oracle Corporation and/or its
  affiliates. Other names may be trademarks of their respective  
+
  affiliates. Other names may be trademarks of their respective
  owners.  
+
  owners.
 
   
 
   
 
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
 
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
 
   
 
   
  mysql>  
+
  mysql>
  
 
Coba Ketik
 
Coba Ketik
Line 61: Line 44:
 
Akan keluar kira-kira:
 
Akan keluar kira-kira:
  
  +--------------------+  
+
  +--------------------+
  | Database          |  
+
  | Database          |
  +--------------------+  
+
  +--------------------+
  | information_schema |  
+
  | information_schema |
  | mysql              |  
+
  | mysql              |
  | performance_schema |  
+
  | performance_schema |
  +--------------------+  
+
| sys                |
  3 rows in set (0.00 sec)  
+
  +--------------------+
 +
  4 rows in set (0.00 sec)
 +
 +
 
 +
 
 +
==Instalasi Lebih Aman==
 +
 
 +
Agar instalasi lebih aman, kita bisa menambahkan langkah berikut. Agar lebih aman lakukan secure installation
 +
 
 +
mysql_secure_installation
 +
 
 +
Jawab “Y” untuk banyak pertanyaan berikut
 +
 
 +
Securing the MySQL server deployment.
 +
Press y|Y for Yes, any other key for No:
 +
New password:
 +
Re-enter new password:
 +
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
 +
  ... Success!
 +
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
 +
  ... Success!
 +
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
 +
  ... Success!
 +
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
 +
  ... Success!
 +
 
 +
 
 +
==Tambahan untuk IPv6==
 +
 
 +
Jika di perlukan, edit Konfigurasi MySQL agar bisa di sambung dari IPv4 dan IPv6
 +
 
 +
vi /etc/mysql/my.cnf
 +
vi /etc/mysql/mysql.conf.d/mysqld.cnf
 +
 
 +
Pastikan
 +
 
 +
bind-address = ::
 +
 
 +
Ini hanya tambahan, tapi tidak terlalu banyak berefek.
  
  

Latest revision as of 13:55, 3 February 2019

Instalasi dengan menggunakan perintah

apt update
apt -y install mysql-server mysql-client

Restart MySQL Server

/etc/init.d/mysql restart

Untuk test IPv6. Edit

vi /etc/hosts

Edit

::1     localhost
::1     localhost6

Test sambungan MySQL ke localhost (localhost) dengan IPv6

mysql -u root -h ::1 -p123456 

Jika berhasil maka akan keluar kira-kira:

mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.25-0ubuntu0.18.04.2 (Ubuntu)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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>  

Coba Ketik

mysql> show databases;

Akan keluar kira-kira:

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)


Instalasi Lebih Aman

Agar instalasi lebih aman, kita bisa menambahkan langkah berikut. Agar lebih aman lakukan secure installation

mysql_secure_installation

Jawab “Y” untuk banyak pertanyaan berikut

Securing the MySQL server deployment.
Press y|Y for Yes, any other key for No: 
New password: 
Re-enter new password: 
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
  ... Success!
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y
  ... Success!
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
  ... Success!
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
  ... Success!


Tambahan untuk IPv6

Jika di perlukan, edit Konfigurasi MySQL agar bisa di sambung dari IPv4 dan IPv6

vi /etc/mysql/my.cnf
vi /etc/mysql/mysql.conf.d/mysqld.cnf

Pastikan

bind-address = ::

Ini hanya tambahan, tapi tidak terlalu banyak berefek.


Pranala Menarik