Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to access a sql database remotely. The database and the server are on two different ips. i have tried commenting out bind-address line and all the other things people have suggested in different posts but am still unable to connect to the sql database.

m using on my server ..

$ mysql -u name -h server-address -p

and am getting.

ERROR 2003 (HY000): Can't connect to MySQL server on 'ip' (111)

Note: I have already granted all privileges to the specific user name and the web server and sql database is on ubuntu server.

SQL EXCEPTION : Failed to link account
share|improve this question

migrated from stackoverflow.com Dec 8 '11 at 15:40

This question came from our site for professional and enthusiast programmers.

4  
Is mysqld running? –  zerkms Dec 8 '11 at 7:25
    
yes it is running and listening on port 3306 –  Nothan Dec 8 '11 at 7:29
2  
What about firewalls? –  zerkms Dec 8 '11 at 7:31
    
I dont have any firewall installed. –  Nothan Dec 8 '11 at 7:33
1  
where as my service provide have one and they said so they have opened port 3306. Can it be still off ? –  Nothan Dec 8 '11 at 7:35
show 8 more comments

2 Answers

The (111) in parenthesis gives you what's wrong. (Access denied)

This page on MySQL.com covers this issue fairly extensively, I'd start there.

Chances are there's something off with the host part of your grants;

share|improve this answer
add comment

You may need to just simply grant access.

mysql> CREATE USER 'MY_USERNAME'@'localhost' IDENTIFIED BY 'MY_PASSWORD'

mysql> GRANT ALL PRIVILEGES ON 'MY_DATABASE'.* TO 'MY_USERNAME'@'12.34.56.78' IDENTIFIED BY 'MY_PASSWORD'; 
share|improve this answer
add comment

Your Answer

 
discard

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