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 attempting to connect MySQLWorkbench to a remote MySQL Server.

The server has granted access to

user@IPAddress

However, when I try to connect MySQLWorkbench, it sends

user@computername 

instead. How do I configure the connection to use the IP address instead in MySQLWorkbench?

Reference: The remote server is on the local network, so I need to use the local IP address assigned to my client.

EDIT

What I have tried so far:

executed

sudo service mysql start --skip-name-resolve

from the server:

mysql -u user@IPAddress -p --host=(ServerIPAddress)

Returns:

mysql>

So that tells me the user account is operational. Furthermore, I confirmed it exists using:

select user from mysql.user;

returning a table of all users, of which the user I am using is present.

I have also opened the port 3306:

sbin/iptables -A INPUT -i eth0 -s clientIPAddress -p tcp --destination-port3306 -j ACCEPT

Still I encounter

Access Denied for user
user@ComputerName (using password: YES)

Answer: I deleted the original user account

DROP USER 'user@IPAdress'

and added it back:

GRANT ALL on foo.* To 'user'@'IPAdress' IDENTIFIED BY 'password';

The tick locations are significant as the user name was actually:

user@IPAdress

not

user

MySQLWorkbench is now able to connect!

share|improve this question
add comment

1 Answer

MySQL automatically attempts to do a reverse DNS lookup of any IP's that try to connect to it, and the DNS name is what gets checked against your grants.

If you start up mysqld with the --skip-name-resolve option, it will skip DNS lookups and match against IP addresses instead.

Reference: http://dev.mysql.com/doc/refman/5.0/en/host-cache.html

share|improve this answer
    
I restarted MySQL Server with the switch you suggested and it still is not letting me connect and echoing Access denied for user@computername –  Android Addict Nov 4 '13 at 18:29
    
What happens if you try to connect with mysql -u (whatever) -p --host=(ip address of the server) ? –  Mikey T.K. Nov 4 '13 at 18:36
    
I can do this from the server and connect just fine using the credentials I am using with MySQLWorkbench. However, MySQL is not installed on my client so I can't do it from there. –  Android Addict Nov 4 '13 at 19:23
add comment

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.