Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a gentoo where is installed a mysql server. I need a remote access to this server, so I have modified the option bind address in the file /etc/mysql/my.cnf bringing it from

bindaddress: 127.0.0.1

to

bindaddress: MY_FOREIGN_IP

And in this way I obtain a remote access to the mysql server.

The problem is that I have a local service that uses 127.0.0.1 ip to talk with my database. If I change the bindaddress option, this service can't reach mysql server anymore.

There is a way to solve this issue, without using ssh tunnel?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You can bind to 0.0.0.0, so that MySQL will accept connections to any IP address that exists on the host, including 127.0.0.1.

Local clients can usually also connect via a unix socket; check the config for a socket: line. That may be a viable alternative to using 127.0.0.1.

Make sure that the MySQL users have sufficient privileges from the client IP they are connecting from.

share|improve this answer
    
Perfect! Thank you wurtel! –  Bau Miao Feb 4 at 8:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.