Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a MySQL server running on my work computer, which runs Mac OS X Maverick. I want to access it from home computer, which also has Mac OS Maverick. From terminal, if in 1 tab, I ssh into my work computer and just let the ssh session sit there without being idle, then on another tab, I can access MySQL server. However, without the ssh session running, I will get following error

ERROR 2003 (HY000): Can't connect to MySQL server on 'SERVER_IP_ADDRESS' (60)

I've tried to modify my.cnf file on the server by commenting out bind-address or assigning it to 0.0.0.0 but it doesn't work.

Why is it like that? How can I configure the server so that it allows remote access without having to run ssh on the client? Can someone please help?

Thanks,

share|improve this question
add comment

1 Answer 1

I hope you need to create the user for remote access with '%' wildcard and grant permissions on DB's.

Step 1:

In my.cnf comment out your bind address

# bind-address        = xxx.xxx.xxx.xxx

And restart MySQL Server.

Step 2:

Then you need to grant permissions to user for remote access

GRANT ALL ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypass';

Please have a look on How to enable remote connection.

share|improve this answer
    
I've tried this setting (commenting out bind-address) before and it didn't work. I've created a user and granted all permission as well. mysql> show grants for 'home'; | Grants for home@% | GRANT ALL PRIVILEGES ON *.* TO 'home'@'%' IDENTIFIED BY PASSWORD '...' WITH GRANT OPTION | –  chepukha Jan 2 at 5:32
    
Do you have any firewall in place ? If it is please disable that. –  Abdul Manaf Jan 2 at 5:36
    
Yes, I can access the server when firewall is turned off. But can I configure the firewall to allow remote access to sql server rather than completely turn it off? On the server, in firewall settings, I've set mysqld to "allow incoming connections" –  chepukha Jan 2 at 6:00
    
Do you have SQL Server also installed on same machine ? –  Abdul Manaf Jan 2 at 6:05
    
Yes, I do. You mean SQL server and Firewall on the same machine? –  chepukha Jan 2 at 6:06
show 2 more comments

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.