Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need enable the remote access for mysql on my Mac (OS X 10.8).

I installed MySQL from the .dmg downloaded from the MySQL website (So no MAMP). I works great on localhost, now how do I enable remote access?

Do I need to enable port-forwarding on my rooter to make it work (by default it is on port 3306, right?)

share|improve this question
up vote 2 down vote accepted

You need to GRANT privileges to an account with hostname "%", for forwarding ports, refer to your routers manual or use Portforward. We can't help you without knowing your router model, just try to search a bit for yourself.

share|improve this answer
Port forwaring is not the problem. I know how to do it. Just wanted to know if it was necessary. Is there nothing else to do than greating privileges ? (I thought i needed to create or modify some config file) – Matthieu Riegler Oct 21 '12 at 22:09
No, in older versions of MySQL you would have to set certain IP addresses that can access the whole server, but newer versions accept this kind of whitelist per grant - if you know the MySQL database will only be accessed by one remote IP, you can simply use that IP instead of % – Gant Oct 21 '12 at 22:17
It won't be one remote ip so I went for the %. I enabled the port forwarding. I'm try this tomorrow to see if it works. Thx. – Matthieu Riegler Oct 21 '12 at 22:21

Yes, you need to set a NAT for the port. Then you will be able to access from anywhere but not from your local network by trying to access via your WAN IP. It will not work if you test it with your WAN IP on your local computer. Just try from another computer not on the same network.

And also be sure that you granted the port access in the firewall if you use one.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .