Posted by: M'Creative | 5 August 2011

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.168.1.2’ (111)


Kahayan, 5 Ramadhan 1423 H, menjelang maghrib

#mysql -h 192.168.1.2 -u bloon -p

ERROR 2003 (HY000): Can’t connect to MySQL server on ‘192.168.1.2’ (111)

1. Masuk server via ssh

#ssh -Y bloon@192.168.1.2

2. Edit file my.conf

#nano /etc/mysql/my.conf

3. Cari baris bind-address  = 127.0.0.1

4. Ganti dengan ip server

bind-adress =192.168.1.2

5. Disable firewall

#ufw disable
Firewall stopped and disabled on system startup

6. Restart mysql

#/etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mysql ; start mysql. The restart(8) utility is also available.
mysql stop/waiting
mysql start/running, process 3117

7. Tes koneksi dari terminal client

#mysql -h 192.168.1.2 -u bloon -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 34
Server version: 5.1.54-1ubuntu4 (Ubuntu)

Alhamdulillah. MySQL bisa di remote dari luar.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: