LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-19-2008, 08:05 PM   #1
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Rep: Reputation: 40
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!
 
Old 01-19-2008, 09:43 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

It's probably the user authentication. Have a look at:
http://dev.mysql.com/doc/refman/5.0/...ing-users.html

Dave
 
Old 01-20-2008, 09:00 AM   #3
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Original Poster
Rep: Reputation: 40
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.
 
Old 01-20-2008, 09:55 AM   #4
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Can you telnet to port 3306 on the DB host from the remote side?

Dave
 
Old 01-20-2008, 10:27 AM   #5
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Original Poster
Rep: Reputation: 40
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.
 
Old 01-20-2008, 11:16 AM   #6
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
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
 
Old 01-20-2008, 12:19 PM   #7
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Original Poster
Rep: Reputation: 40
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.
 
Old 01-20-2008, 12:29 PM   #8
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Original Poster
Rep: Reputation: 40
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.
 
Old 01-20-2008, 12:29 PM   #9
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Ah. mysqld isn't listening...

Edit: Never mind, I see you've got it. Cool cool.

Dave

Last edited by ilikejam; 01-20-2008 at 12:31 PM.
 
Old 01-20-2008, 12:32 PM   #10
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mageia
Posts: 807

Original Poster
Rep: Reputation: 40
Heh, looks like I must have picked up your thoughts down the M6 as you suddenly realised it! ;-)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error connect to server at 'localhost' failed pete44904 Linux - Server 10 11-23-2012 06:08 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Software 3 06-28-2007 11:46 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration