LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-22-2008, 07:04 AM   #1
dereko
Member
 
Registered: May 2004
Location: Ireland
Distribution: Debian
Posts: 56

Rep: Reputation: 15
Mysql remote access


Right have a problem connecting to my mysql server remotely.

I can do
mysql -h localhost -u jeebers -p
and that works

I can't on the other hand from the local machine do this
mysql -h x.x.x.x -u jeebers -p
where the x.. is the IP address of the machine.

I get an error
ERROR 2003 (HY000): Can't connect to MySQL server on 'x.x.x.x'
(110)


Now its a Debain etch machine and i've edited my "my.cnf" file and
commented out bind-address and skip-networking. I've also restarted
mysql.

Anyone any thoughs on why it won't let me connect with the dedicated IP
but it will with localhost?
 
Old 04-22-2008, 07:17 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have you checked your firewall settings?

Also, what does netstat -l | grep sql show?
 
Old 04-22-2008, 07:21 AM   #3
dereko
Member
 
Registered: May 2004
Location: Ireland
Distribution: Debian
Posts: 56

Original Poster
Rep: Reputation: 15
# netstat -l | grep mysql
tcp 0 0 *:mysql *:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 1659061 /var/run/mysqld/mysqld.sock


Yea there might be something in the firewall settings that isn't allowing this but i can't figure out what that would. Its a dedicated server in a hosting company's environment. Any other tests i can do to narrow it down/
 
Old 04-22-2008, 07:25 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
try

telnet se.rv.er.IP 3306

from the remote machine
 
Old 04-22-2008, 07:27 AM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Also

iptables -L
 
Old 04-22-2008, 07:54 AM   #6
dereko
Member
 
Registered: May 2004
Location: Ireland
Distribution: Debian
Posts: 56

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
try

telnet se.rv.er.IP 3306

from the remote machine
when i try this it seems to connect and return garbage which i think is what is expected.
 
Old 04-22-2008, 07:54 AM   #7
dereko
Member
 
Registered: May 2004
Location: Ireland
Distribution: Debian
Posts: 56

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by billymayday View Post
Also

iptables -L
I'm not familiar with this. but
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

that is all that said?
 
Old 04-22-2008, 11:57 AM   #8
G4george
Member
 
Registered: Nov 2005
Location: Houston, Tx
Posts: 34

Rep: Reputation: 15
Check the Mysql db to make sure the system in allowed access by IP. The permissions table on MySql is strict on who can access the program.
 
Old 04-22-2008, 12:12 PM   #9
dereko
Member
 
Registered: May 2004
Location: Ireland
Distribution: Debian
Posts: 56

Original Poster
Rep: Reputation: 15
I solved the problem in the end.

I needed to add -P3306 to my mysql request from the remote machine and it worked. i was defaulting to somethign else for some reason.

I still can't connect from localhost with the IP but i suppose that doesn't really matter.

thanks for the suggestions.
 
Old 04-22-2008, 03:55 PM   #10
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
If it's a public IP that's not surprising
 
Old 04-22-2008, 07:46 PM   #11
marquardl
Member
 
Registered: Apr 2008
Posts: 100

Rep: Reputation: 15
grant ... to 'user'@'localhost'

Maybe the username you use is granted access only on localhost. Most tutorials suggest something like "grant all privileges on db.* to 'user'@'localhost' ...", so maybe you should grant access to that user with something like " ... to 'user'@'x.x.x.x' ...". (x.x.x.x is obviously to be replaced by the IP number).

Don't know if it solves your problem, could be caused by something else as well. Maybe worth trying...

Server issues

Last edited by marquardl; 05-01-2008 at 04:08 AM.
 
  


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
remote mysql access in slackware? Shioni Linux - Networking 8 11-29-2006 05:58 PM
Remote MySQL access gauge73 Linux - Software 2 03-05-2006 08:24 AM
MySQL 4.1 remote access (Fedora Core 4) james.reid Linux - Software 2 01-04-2006 02:38 AM
MySQL 4.1 remote access james.reid Linux - Software 0 01-03-2006 05:55 AM
can't get remote access to mysql server hughes28105 SUSE / openSUSE 6 09-17-2005 09:07 PM

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

All times are GMT -5. The time now is 05:20 AM.

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