Log in

View Full Version : Connect database from other localhost



hemi519
04-20-2012, 07:31 AM
Hi All,

Can anyone tell how to connect to database in different server. Now if i want in Localhost i will give

Host = Localhost
username = abcdef
password = abcdef

But if i want to connect for another database in different ip

Host = 192.168.1.14
username = abcdef
password = abcdef


The above configuration is not working. I am using Ubuntu OS, can anyone help me in this.

djr33
04-20-2012, 07:39 AM
In theory, that's fine. The problem is in the details, I think.

Of course you should be sure that the remote server allows external connections. That could be disabled. If so, you need to enable it.

hemi519
04-20-2012, 07:43 AM
where can i enable those settings?

djr33
04-20-2012, 07:46 AM
In the MySQL configuration on the server running the database. It might depend on how you're managing it.

hemi519
04-20-2012, 07:56 AM
Thanks, I got it working

In /etc/mysql/my.conf look for this line:

bind-address = 127.0.0.1

change it to

#bind-address = 127.0.0.1

now restart /etc/init.d/mysql restart