Niwatori (/niwɑθorɪə/: a Japanese word for chicken), is a twenty something web designer and programmer who lives in Bandung, Indonesia.

Akses MySQL dari Remote Host


Pekerjaan kecil yang simple, tapi selalu berulang “lupa” setiap menginstall fresh mysql server yaitu: akses mysql dari remote host!

Di lingkungan kerja yang menggunakan LAN kita sering menemui kondisi dimana komputer lain (remote host) ingin mengakses mysql server dari non localhost, umumnya menggunakan GUI tools seperti MySQLFront atau SQLYog misalnya. Di Linux (khususnya dalam kasus ini Ubuntu), akses mysql server dari luar secara default dimatikan. Berikut cara mengaksesnya dari luar :
diki@chickenhost:>  sudo gedit /etc/mysql/my.cnf
Commenting atau hapus baris ini untuk menghindari local binding :
# bind-address = 127.0.0.1
Tambahkan host ”%” (dari manapun) untuk user mysql anda (apapun, misalnya: root) ke tabel user yang ada pada database mysql :
diki@chickenhost:>  mysql -u root
mysql> connect mysql
Reading table information for completion of table and column names
Connection id: 16
Current database: mysql
mysql> INSERT INTO `user` ( `Host` , `User` , `Password` , `Select_priv` , 
`Insert_priv` , `Update_priv` , `Delete_priv` , `Create_priv` , `Drop_priv` , 
`Reload_priv` , `Shutdown_priv` , `Process_priv` , `File_priv` , `Grant_priv` , 
`References_priv` , `Index_priv` , `Alter_priv` , `Show_db_priv` , 
`Super_priv` , `Create_tmp_table_priv` , `Lock_tables_priv` , `Execute_priv` , 
`Repl_slave_priv` , `Repl_client_priv` , `Create_view_priv` , 
`Show_view_priv` , `Create_routine_priv` , `Alter_routine_priv` , 
`Create_user_priv` , `ssl_type` , `ssl_cipher` , `x509_issuer` , `x509_subject` , 
`max_questions` , `max_updates` , `max_connections` , `max_user_connections` )  
VALUES ( '%', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', 
'', '', '', '0', '0', '0', '0' );
Query OK, 1 row affected (0.00 sec)
mysql> quit
Restartlah mysql server :
diki@chickenhost:>  sudo /etc/init.d/mysql restart
Note : untuk query sql di atas (insert into) pastikan 1 baris (siapa tahu salah copy paste).
About this entry
You’re currently reading “Akses MySQL dari Remote Host,” an entry on Hear no chickens, see no chickens, talk no chickens. Published at April 23rd 01:30 PM updated at September 30th 05:45 AM
Sections: ChickenbuntuCyber ChickenAsk Jeeves  Del.icio.us  Digg it  Google  Technorati  Yahoo 

Sorry, comments are closed for this article.