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'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.

share|improve this question

2 Answers 2

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.

share|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 –  Jakub Arnold Oct 15 '09 at 18:46

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

share|improve this answer

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.