LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   Can't connect to MySQL server remotely on RedHat 9 (https://www.linuxquestions.org/questions/red-hat-31/cant-connect-to-mysql-server-remotely-on-redhat-9-a-99359/)

bper 10-02-2003 07:03 AM

Can't connect to MySQL server remotely on RedHat 9
 
Hi, trying to be as descriptive as I can,
I have a MySQL 4.0.13 server running on RedHat 9.0.
I can connect locally using a user and password for which I issued a MySQL grant on any host.
I have 3 different scenarios producing virtually the same result:
1) I have a RedHat 9.0 system running outside the linksys router on which the MySQL server is running (external network connecting to the MySQL server).
2) A RedHat 9.0 system running inside the router on which the MySQL server is running and
3) An XP system running inside the router.

All 3 machines can ping the MySQL server machine and vice-versa. When trying to connect to the DB server with the MySQL client (mysql -h DB -u user -p databasename) I get the following errors from from the RedHat clients:

Error 2003: Can't connect to the MySQL server running on DB (111)

and from the XP client:
Error 2003: Can't connect to the MySQL server running on DB (10054)

I have no error msgs any other place (no log files). I have no my.cnf file on the database server machine.

What could my problems be? MySQL configuration? Linux configuration? Router configuration?

Sorry if this is too much info, but any help would greatly be appreciated.

Thanks

usernamenumber 10-02-2003 08:34 AM

run 'service iptables status' as root. There could be an errant firewall rule blocking access. mysqld likes to be able to listen on tcp/udp ports 3306.

bper 10-02-2003 08:50 AM

Thanks a lot for responding!

OK, the iptables command shows nothing specific to port 3306, but it shows rejects for tcp/udp from anywhere to anywhere in the RH-Lokkit-0-50-input Chain

usernamenumber 10-02-2003 09:56 AM

Try this:

Do 'service iptables stop'
Then try to connect to mysql again.

If that works, then iptables is your problem. Now, do 'service iptables start' immediately so you don't spend more time than you need to with your firewall down. =:) Once that's done, run redhat-config-securitylevel and make sure to let 3306 through for both tcp and udp. But be warned that this will allow -anyone- to try and access your mysql daemon. If you want to restric access to, say, only your interenal network you willhave to do something like:

iptables -I INPUT -s 192.168.0.0/24 -p tcp --dport 3306 -j ACCEPT
service iptables save

Enjoy!

bper 10-02-2003 10:56 AM

Thanks again for responding!

While I was waiting for your last reply, I changed the redhat security settings (gnome) to allow eth0 as a trusted device and that allowed me to connect to the server.

I will look into your suggestions to apply the appropriate rules for the network.

BTW, I posted this question to another users group and though many people viewed it, no one replied. You're the only one that replied. Whatever the reason for that, I REALLY appreciate your help.

Thanks a lot!!!


All times are GMT -5. The time now is 04:41 AM.