I've commented out the bind-address line in my /etc/mysql/my.cnf

When I do nmap localhost, I see that mysql is correctly listening on 3306, but when I try to connect, I get error 1045.

Do I have to somehow specify whitelist of allowed ips (I've seen this on some shared hosts), or is it possible to allow access from any ip?

I'm using Ubuntu 9.04 x64.

link|improve this question

feedback

2 Answers

up vote 2 down vote accepted

Use a wildcard grant in MySQL to connect from a known range.

Darth, I'm assuming you're on the same LAN as your database and are trying to connect from a remote host AND!!! IPTables is either off or configured to allow 3306. You can grant that specific IP permission, or you can grant a subnet permission.

Granting a specific IP to your server LAN (10.1.1.0/24):

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE 
ON mydatabase.* 
TO 'myappuser'@'10.1.1.%'
IDENTIFIED BY 'mypassword';

To be clear, using a wildcard is not the best practice, but may be safe depending on your situation. Just be a diligent DBA and monitor the traffic to make sure this configuration is not a threat to your data.

link|improve this answer
Actualy, I'm not on the same LAN, I'm connecting to my VPS in a galaxy far far away ... IPTables is off – Darth Oct 15 '09 at 18:46
feedback

The old MySQL Query Browser and MySQL Administrator have been replaced by MySQL Workbench.

MySQL Workbench includes: - Model (replacing DBDesigner) - Query (replacing MySQL Query Browser) - Admin (replacing MySQL Administrator) - SSH-Tunnel (Remote Admin)

MySQL Workbench discussions:
- http://forums.mysql.com/index.php?151

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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