Instalasi MySQL: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Onnowpurbo (talk | contribs)
No edit summary
Onnowpurbo (talk | contribs)
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
Instalasi MySQL di Ubuntu relatif sederhana hanya menggunakan perintah,
Instalasi [[MySQL]] di [[Ubuntu]] relatif sederhana hanya menggunakan perintah,


  # apt-get install mysql-server libmysqlclient15-dev
  apt-get update
apt-get -y install mysql-server mysql-client


Untuk menjalankan MySQL Server cukup menggunakan perintah
Biasanya akan di tanya root password.
Jika kita masih belajar dapat memasukan root password


  # /etc/init.d/mysql restart
  123456


Ada baiknya menambahkan beberapa file tambahan untuk memudahkan proses pembuatan Content Management System (CMS) di Web Server dengan cara menginstalasi aplikasi PHP, adodb, GD, PEAR melalui perintah,
Agar lebih aman lakukan secure installation


  # apt-get install libphp-adodb libgd2-xpm libgd2-xpm-dev php5-mysql php5-gd php5-curl \
  mysql_secure_installation
php-image-graph php-image-canvas php-pear


Mungkin yang agak pusing kepala adalah menset MySQL Server. Sebetulnya tidak banyak yang harus dikerjakan untuk mensetup database di MySQL. Biasanya pertama kali kita perlu menset password root dari MySQL database. Setting password root MySQL dapat dilakukan dengan cara masuk ke aplikasi administrator MySQL dengan perintah,
Jawab


  # mysql
  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!


Kemudian set PASSWORD root agar sesuai 'password' melalui perintah dengan,


mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');
Untuk menjalankan [[MySQL Server]] cukup menggunakan perintah


Beberapa langkah selanjutnya yang sering digunakan untuk menset user, password user, database biasanya saya menggunakan perintah berikut,
/etc/init.d/mysql restart


  # mysql -u root -p  
 
 
Masuk ke MySQL monitor
 
 
mysql -u root -p123456
 
Ketik
 
mysql> show databases;
 
Akan keluar
 
+--------------------+
| Database          |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
 
 
 
Setup database
 
  mysql -u root -p  
  Enter password:  
  Enter password:  
  mysql> create database moodle;  
 
  mysql> create database databasekita;  
  mysql> grant INSERT,SELECT on root.* to user@localhost;  
  mysql> grant INSERT,SELECT on root.* to user@localhost;  
  mysql> SET PASSWORD FOR user@localhost=PASSWORD('passworduser');  
  mysql> SET PASSWORD FOR user@localhost=PASSWORD('passworduser');  
Line 32: Line 75:




==Referensi==
* http://www.mysqltutorial.org/
* http://dev.mysql.com/
* http://ubuntu.flowconsult.at/en/mysql-set-change-reset-root-password/ - Reset Password [[MySQL]]


==Pranala Menarik==
==Pranala Menarik==


* [[MySQL]]
* [[MySQL: Instalasi Ulang]]
* [[Linux Howto]]
* [[Linux Howto]]
* [[Tip Membangun Server Sendiri]]
* [[Backup isi database MySQL]]
* [[Reset Password MySQL]]
[[Category: Database]]

Latest revision as of 01:50, 8 June 2015

Instalasi MySQL di Ubuntu relatif sederhana hanya menggunakan perintah,

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

Biasanya akan di tanya root password. Jika kita masih belajar dapat memasukan root password

123456

Agar lebih aman lakukan secure installation

mysql_secure_installation 

Jawab

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!


Untuk menjalankan MySQL Server cukup menggunakan perintah

/etc/init.d/mysql restart 


Masuk ke MySQL monitor


mysql -u root -p123456

Ketik

mysql> show databases;

Akan keluar

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


Setup database

mysql -u root -p 
Enter password: 
mysql> create database databasekita; 
mysql> grant INSERT,SELECT on root.* to user@localhost; 
mysql> SET PASSWORD FOR user@localhost=PASSWORD('passworduser'); 
mysql> grant CREATE, INSERT, SELECT, DELETE, UPDATE on databasekita.* to user@localhost; 
mysql> grant CREATE, INSERT, SELECT, DELETE, UPDATE on databasekita.* to user; 
mysql> exit


Referensi

Pranala Menarik