Can't connect to (non localhost) mysql server from laptop or desktop.
I have set-up mysql on my home server machine which has a static ip address of 192.168.0.1. This is a command-line only version of Mandriva.
I then set-up the root sql password and created a database. I have been running a program called Knoda on a couple of machines and that works just fine connecting to localhost as root, but I just cannot get it to connect to the mysql server running on my 192.168.0.1 home server. I should say here that I am no expert on sql of any flavour and and learning as I go along. I have got databases up and running on a couple of machines running Knoda, but always connected to the mysql engine running on that local machine. Is it most likely to be a firewall issue? (Although I have tried switching it off to no avail.) Do I need to open up the relevant IP port for incoming traffic or should mysql have done that? Could it be a separate issue altogether? Any ideas would be gratefully received! |
Hi.
It's probably the user authentication. Have a look at: http://dev.mysql.com/doc/refman/5.0/...ing-users.html Dave |
Thanks for the suggestion, Dave. I can log in on the server itself as the user, but not from a remote machine, which makes me think it's something to do with the networking set-up rather than permissions.
|
Can you telnet to port 3306 on the DB host from the remote side?
Dave |
When I try I get this:
[robertw@Desktop ~]$ telnet 192.168.0.1 3306 Trying 192.168.0.1... telnet: connect to address 192.168.0.1: Connection refused telnet: Unable to connect to remote host: Connection refused I can ping and connect to all my smbmounts on 192.168.0.1. I believe 3306 is the TCP port that mysql uses by default and I haven't altered that. |
Looks like it is a network/firewall issue then.
Try running: # iptables -I INPUT -p tcp --dport 3306 -j ACCEPT on the DB host to punch a hole in the iptables firewall (assuming iptables is running). If there's still no joy, post the output from: # netstat -pantu | grep LISTEN Dave |
Ah, might have made some progress with the netstat:
[root@server robertw]# netstat -pantu | grep LISTEN tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN - tcp 0 0 0.0.0.0:2273 0.0.0.0:* LISTEN 4028/mysqlmanager tcp 0 0 0.0.0.0:41028 0.0.0.0:* LISTEN 3773/rpc.statd tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 4023/smbd tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 3692/portmap tcp 0 0 0.0.0.0:58709 0.0.0.0:* LISTEN 4133/rpc.mountd tcp 0 0 0.0.0.0:42037 0.0.0.0:* LISTEN - tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 5230/0 tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 4023/smbd tcp 0 0 :::22 :::* LISTEN 4017/sshd tcp 0 0 ::1:6010 :::* LISTEN 5230/0 So, looks like it's actually listening on 2273? Or is that a different package which is purely for management? If I change the frontend package (Knoda) to use port 2273 on 192.168.0.1 then I get bad username/password pairing error. Which suggests it's not what I should be logging on to as those credentials work if I ssh in to the machine and log on directly. |
Delighted to say, I've sussed it. It was actually a line in /etc/my.cnf that simply says:
skip-networking if you comment that out with a # symbol it works. Many thanks for your help, really appreciate it. :) |
Ah. mysqld isn't listening...
Edit: Never mind, I see you've got it. Cool cool. Dave |
Heh, looks like I must have picked up your thoughts down the M6 as you suddenly realised it! ;-)
|
All times are GMT -5. The time now is 05:47 PM. |