LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-22-2004, 03:33 PM   #1
blood_omen
Member
 
Registered: Apr 2004
Location: Canada
Distribution: OpenBSD 3.6, Slackware 10.1
Posts: 134

Rep: Reputation: 15
Connecting to Mysql


Greetings:

I'm having troubles trying to connect to mysql from a remote host, despite the fact that this remote host is in the same network, anyways. I'm trying to connect via MySQL Administrator from a windows machine and the error it gives me is
"Cannot connect to specify host", I know the server is running because I can connect using phpMyAdmin, the main reason why I need to connect is because I'm using dreamweaver for web development and I need mysql connectivity, and when I try to connect to the server via dreamweaver it gives me the same error.

Once I read that there is a conf file that will allow or disallow TCP/IP connections in mysql, unfortunately, that was quite a long time ago and I don't remember neither the site with the how-to nor the aforementioned file.

Any advise in how could I connect to the server will be appreciated, thanks in advance.
 
Old 07-22-2004, 03:38 PM   #2
dragozfire
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Rep: Reputation: 0
I would check out your /etc/mysql directory your config file should be in there and it should have something about a networking option, if memory serves me right, by default mysql has the networking stuff disabled my default, and postgreqsl has it enabled by default.
 
Old 07-22-2004, 06:24 PM   #3
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
From /etc/mysql/my.conf

Code:
# The skip-networking option will no longer be set via debconf menu.
# You have to manually change it if you want networking i.e. the server
# listening on port 3306. The default is "disable" - for security reasons.
skip-networking
Comment that line out and do `/etc/init.d/mysql restart`

FWIW phpmyadmin works b/c in that instance the php program is talking to the mysql server via localhost.
 
Old 07-22-2004, 07:05 PM   #4
blood_omen
Member
 
Registered: Apr 2004
Location: Canada
Distribution: OpenBSD 3.6, Slackware 10.1
Posts: 134

Original Poster
Rep: Reputation: 15
I commented that line and restarted mysql, now when I try to connect it said my host is not allowed not connect to that MySQL server
 
Old 07-22-2004, 07:15 PM   #5
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
as root, do:

netstat -tuan

do you see an entry for port 3306? That's where my mysql server listens.
 
Old 07-22-2004, 07:37 PM   #6
blood_omen
Member
 
Registered: Apr 2004
Location: Canada
Distribution: OpenBSD 3.6, Slackware 10.1
Posts: 134

Original Poster
Rep: Reputation: 15
Here is the line concerning mysql or port 3306 comming from that command:

Proto Recv-Q SendQ Local Address Foreign Address State
tcp 0 0 0.0.0.0:3306 0.0.0.0:* Listen

I noticed from other services, example apache, that their Local Address were the server IP address, whereas the entry for for port 3306 give no address. Might it be the reason of why I'm unable to connect to MySQL, because it is not listening on the real IP? If it so, how may fix it?
 
Old 07-23-2004, 01:20 AM   #7
blood_omen
Member
 
Registered: Apr 2004
Location: Canada
Distribution: OpenBSD 3.6, Slackware 10.1
Posts: 134

Original Poster
Rep: Reputation: 15
Problema solved

After a couple of hour googling around and reading the MySQL documentation from the MySQL website I finally solved the problem.
I commented this line "skip-networking" in my.cnf and andded and entry to the user table in the MySQL grand_table specifying the host from which I'm connecting to the user that is allow to connect to the server, in this case me, as a security meassure, I just did it to mysqlf, a user with restricted privileges and not root, therefore root is not allowed to connect from anywhere else except the server itself.

Thanks a lot for all the help.
Good night
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Connecting to MySQL ksalopek Linux - Software 5 06-11-2004 09:07 AM
connecting to mysql dkc_ace Linux - General 2 03-22-2003 07:18 PM
Connecting to mysql webee Linux - Software 2 01-30-2003 02:47 PM
connecting mysql by php norbs Linux - Software 1 07-25-2002 01:40 AM
Mysql is not connecting from servlet.But connecting from java, help pls Harish_f Linux - General 0 05-08-2002 03:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration