Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can't connect to MySQL

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
tongro
Posts: 66
Joined: 2005-09-11 13:27
Location: Ireland

Can't connect to MySQL

#1 Post by tongro »

I'm quite new to Linux, and very new to Debian. I recently installed Sarge, and then MySQL, on a machine connected to my home network. I can play with MySQL on localhost no problem, and can ping the machine from my network, but I can't connect to MySQL (using default port 3306) from the network; I get the message "can't connect to MySQL server on [IP-address]". I'm sure it's not an authentication issue; the user table is set up to allow global anonymous access.

So, can anybody tell me what I need to do now?

Thanks a lot.

User avatar
petteri
Posts: 48
Joined: 2004-09-14 20:11
Location: Finland

#2 Post by petteri »

Hello. Don't really know if this has anything to do with your problem but if I log in to mysql from command line (mysql -u petteri -p) i have to have granted user rights to petteri@localhost but if I use php-application (from the same machine) the use rights have to be granted to user petteri@localhost.localdomain.

tongro
Posts: 66
Joined: 2005-09-11 13:27
Location: Ireland

#3 Post by tongro »

Thanks for that.

The message indicates it's not an authentication problem, but a port-access problem. If it was to do with authentication, the message would say something like "access denied for user ...". In any event, my user table has an entry for ''@'%' with no password, which allows anonymous access from anywhere.

I'm thinking it could be some sort of firewall issue. Is Debian configured by default to block all ports? If so, what would I need to do to open port 3306?

PopsTX
Posts: 18
Joined: 2005-07-15 23:01
Location: Kermit, Tx

MySql

#4 Post by PopsTX »

The easiest way to "Play" with MySql is via PHPMyAdmin... Set up your server, install PHP4 and PHPMyAdmin.

Beats the heck out of shell commands!
Even if you are on the right track, you'll get run over if you just sit there.

tongro
Posts: 66
Joined: 2005-09-11 13:27
Location: Ireland

#5 Post by tongro »

I also have application programs that want to connect ...

gollll
Posts: 2
Joined: 2005-09-13 21:00
Location: Switzerland

Re: Can't connect to MySQL

#6 Post by gollll »

Hello,

I have exactly the same problem as tongro. On a fresh Sarge installation I can connect to mysql from localhost, but not from other machines on the lan.

This is what I see:

> mysql -h 192.168.1.20
ERROR 2003: Can't connect to MySQL server on '192.168.1.20' (111)
  • mysql is up and running, local connections work fine
  • mysql is in it's default configuration which should accept connection on port 3306
  • Other services like ssh or apache work fine and I can acces them on the lan
  • It seems like port 3306 is blocked or hidden
  • I can't remember having installed a firewall. How can I check?
  • I've checked other network connections on strange ports like 24684. No problem.
  • I've checked the logs mysql.err, mysql.log. They are empty.
So I'm really stuck. this is not the first time I'm installing mysql, but I've never had such a problem.

Does anybody have an idea what goes wrong?

thanks

Rolf

tongro
Posts: 66
Joined: 2005-09-11 13:27
Location: Ireland

#7 Post by tongro »

I fixed my problem, with help from the folks at debianhelp.org. I had a line in my.cnf saying something like "bind-address=127.0.0.1". Deleting (or commenting) this line fixed it. You might also find a line saying "skip-networking". Delete this also.

gollll
Posts: 2
Joined: 2005-09-13 21:00
Location: Switzerland

#8 Post by gollll »

Hi tongro,

Yes! That's was exactly the problem!

Everything runs fine now. Thanks a lot for your help...

Cheers

Rolf

Post Reply