LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-06-2005, 01:04 AM   #1
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Rep: Reputation: 16
MySQL not listening on port 3306


Hi,

I have MySQL on a Slackware 10.2 server but it does not listen on port 3306.

In my "my.cnf", port=3306 and "skip-networking" is not there

when I try "netstat -atn" 3306 is not there.

If y try "netstat -an | grep 3306" nothing

MySQL is running fine whit my local PHP script but not with some java application that need port 3306 to listen to gain acces to database.

I have search on the web all night and cannot find something !! everybody that have this trouble is because of "skip-networking" !!

Someone know what can I try...

Thanks,

Franck
 
Old 10-06-2005, 08:51 AM   #2
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 16
I've finally found that if I connecto to mysql (mysql -p -u root)

and type in "SHOW VARIABLES;"

skip_networking = ON

If I type:

mysql > SET GLOBAL skip_networking = Off;

It tell me: unknown system variable 'skip_networking'

Why !!

If I type: mysql> SHOW VARIABLES LIKE 'skip_networking';

It respond me: skip_networking = On

does I misstype something ?

Last edited by mr_sarge; 10-06-2005 at 08:53 AM.
 
Old 10-06-2005, 09:02 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Put
Code:
port = 3306
in the [mysqld] section of your my.cnf.
 
Old 10-06-2005, 09:08 AM   #4
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 16
already there...

My issue now is really that I don't find how to modify the skip_networking variable in mysql.

I've try 2 things:

mysql> SET GLOBAL skip_networking=off;

and

mysql> SET @@global.skip_networking=off;

In the 2 case, mysql reply:

ERROR 1193 (HY000): Unknown system variable 'skip_networking'
 
Old 10-06-2005, 09:21 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
skip_networking is a command line option. Take a look at your mysql server startup script to see if it starts with --skip_networking
 
Old 10-06-2005, 12:31 PM   #6
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 16
ok, so the mysql startup script, you mean de rc.mysqld ?

I've look in it and don't sea --skip-networking.

In my my.cnf, i've try different things.

First pus a "#skip-networking" or "#skip_networking" or "#--skip-networking" but this don't turn off the skip-networking.

I've also try these:

skip-networking=off
skip_networking=off
set-variable=skip-networking=off
set-variable=skip_networking=off

but in those case, mysql won't start at all !

Last edited by mr_sarge; 10-06-2005 at 12:35 PM.
 
Old 10-06-2005, 04:31 PM   #7
mr_sarge
LQ Newbie
 
Registered: Oct 2005
Posts: 21

Original Poster
Rep: Reputation: 16
Yes ! get it !!

I was not lokking at the right place in my rc.mysqld !

I've found this line:

SKIP="--skip-networking"

Just comment it to have:

#SKIP="--skip-networking"

restart mysql and 3306 is listening !

Thanks bathory !

hope it will help people around that have the same problem !

bye
 
1 members found this post helpful.
Old 10-26-2005, 12:35 AM   #8
figure8car
LQ Newbie
 
Registered: Jul 2003
Location: Poulsbo, WA
Distribution: DreamLinux
Posts: 11

Rep: Reputation: 0
Thumbs up MySQL not listening on port 3306

I just had the same problem with Mandriva 2006. I searched for hours and came across this thread. It solved my problem too. Thanks for posting guys!
 
Old 03-15-2006, 10:08 PM   #9
sleetdrop
LQ Newbie
 
Registered: Mar 2005
Posts: 16

Rep: Reputation: 0
it really helps.
I can connect my mysql server now.
thanks.
 
Old 05-24-2006, 12:59 PM   #10
jramen
LQ Newbie
 
Registered: Jun 2003
Location: Slovakia
Distribution: Mandrake
Posts: 2

Rep: Reputation: 0
Cool

Quote:
Originally Posted by mr_sarge
Yes ! get it !!

I was not lokking at the right place in my rc.mysqld !

I've found this line:

SKIP="--skip-networking"

Just comment it to have:

#SKIP="--skip-networking"

restart mysql and 3306 is listening !

Thanks bathory !

hope it will help people around that have the same problem !

bye

I had the same problem with Mandriva 2005 Limited Edition, and searched in /etc/init.d/mysqld, but I haven't found such parameter there.

Actually, "ps ax" shows, mysql is truly started with that parameter --skip-networking, so I was investigating further and finally found it.

In this distro, there is another config file for mysql (except for the well-known /etc/my.cnf).
Be sure to look for:

/etc/sysconfig/mysqld

and there is that pesky little line:
MYSQLD_OPTIONS="--skip-networking"

I hope this really helps those folks with Mandriva 2005 LE )
 
Old 06-29-2006, 09:29 AM   #11
kunjuk
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Thanks jramen for the hint on Mandriva 2005 LE!

I was already searching a while with no luck. Saved me a lot more time!

Great!
 
Old 04-21-2008, 11:56 AM   #12
ReinPetersen
LQ Newbie
 
Registered: Oct 2005
Posts: 5

Rep: Reputation: 0
skip_networking is confirmed OFF - still no love

Hi All - hoping for a little guidance,

I've confirmed skip_networking is OFF:

mysql> SHOW VARIABLES LIKE 'skip_networking';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| skip_networking | OFF |
+-----------------+-------+

and, port 3306 is definitely appears in /etc/my.cnf

My only guess is iptables but as far as I can tell, all ports are accepted.

Here is my iptables -L :

Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
DROP tcp -- anywhere anywhere tcp dpts:tcpmux:65535
DROP udp -- anywhere anywhere udp dpts:tcpmux:65535
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


Is it my iptables blocking access? Is there an entry that I can make to open port 3306?

Thanks in advance, Rein
 
Old 12-12-2010, 06:21 AM   #13
gust72
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
ubuntu news

I had the same problem in ubuntu, and went to edit the same file.
now in ubuntu it looks a bit different than skip-networking. This is how it looks:

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

so I replaced bind-address localhost ip with the right ip, mysql restart and that was it.
woulndt be for this post I wouldnt have found that...
thanks guys
 
Old 05-22-2013, 04:36 PM   #14
abma
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
One More File to Edit

I struggled with this for three days now, then I found this awesome thread
on my freeBSD changing the configuration files mentioned didn't help, I also had to change the file " /var/db/mysql/my.cnf"
 
Old 12-03-2013, 04:17 AM   #15
gil_jara
LQ Newbie
 
Registered: Dec 2013
Posts: 1

Rep: Reputation: Disabled
Wink THANKS for listening 3306

Hello!

Im using SMS distro for servers, and I have a lot of hours looking and looking for info, I was checking firewall, Ports, config from phpmyadmin, and nothing...

So I read something about to comment the line with 'skip_networking' but I also found it on my.cnf

Finally thanks to you, I look on /etc/rc.d/rc.mysql and there!

Listening and connecting mysql database.

Thanks!
 
  


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
mysqld running and reading for connections on port 3306, no port 3306 found from scan darkenigmaa Linux - Networking 10 07-13-2016 11:53 AM
How do I allow mysql connections over network (netstat -an | grep 3306 produces nil)? jdruin Linux - Software 6 04-03-2013 10:35 AM
mysql 3306 security sopiaz57 Linux - Security 8 03-07-2004 04:32 PM
Apache listening on port.. well it isn't Newman_SCO Linux - Newbie 10 08-15-2003 12:32 PM
mysql port 3306 bulliver Linux - Security 4 04-17-2003 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:28 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