?
Solved

Connecting to Port 3306

Posted on 2004-04-10
10
Medium Priority
?
6,521 Views
Last Modified: 2013-11-22
I have MySQL setup on a FreeBSD system but cannot connect remotely to the MySQL server. It was suggested that I try to Telnet to port 3306 to see if there was any response, but doing this does not give a connection.

Any ideas where I can look to solve this problem.

Thanks in advance for any help

Richard.H
0
Comment
Question by:RICHARDH
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 1

Accepted Solution

by:
fyerk earned 80 total points
ID: 10797380
Make sure the daemon is listening on 3306:
> sockstat -4l | grep 3306

If not, make sure the daemon is running.
> ps -U mysql

If the daemon isn't running, start it:
> /usr/local/etc/rc.d/mysql-server.sh

If you've already started it with the script, check /var/log/messages to see if there were any errors that prevented it from starting up.
0
 
LVL 62

Assisted Solution

by:gheist
gheist earned 80 total points
ID: 10798385
Maybe you run mysqld in AF_UNIX socket mode (aka secure mode) and it never opens AF_INET socket
0
 

Author Comment

by:RICHARDH
ID: 10800081
HI there,

How can I test if I have opened mysqld in Secure Mode. And if I have how can I make the change.

Thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 62

Expert Comment

by:gheist
ID: 10800228
This is unsafe, so read TFM to find out all insecurity you want to open...
0
 
LVL 1

Assisted Solution

by:pixr99
pixr99 earned 80 total points
ID: 10814079
You may also want to check /etc/hosts.allow to make sure that tcp-wrappers isn't blocking access to the MySQL daemon.  If wrappers are turned on you'll probably have to add a line like this:

mysqld : my.ip.add.ress : allow

0
 
LVL 1

Assisted Solution

by:kolyakarpov
kolyakarpov earned 80 total points
ID: 10977789
There maybe firewall blocking access to port 3306.

Make shure there are only one rule like 65535 32580 14666937 allow ip from any to any
> ipfw show

If there are plenty of rules add the folowing rules before last rule (XXX is number of rule (1 column)):
> ipfw add XXX allow tcp from any to me 3306
> ipfw add XXX+1 allow tcp from me 3306 to any

0
 
LVL 18

Assisted Solution

by:John Gates, CISSP
John Gates, CISSP earned 80 total points
ID: 11152956
You may also want to check and see if your user has access from any host or just localhost.  If you are getting access denied errors, that is where I would start.

D
0
 
LVL 4

Expert Comment

by:frankcheong
ID: 11185306
After all, you missed the MySQL security.

On the mysql server type the following :-

mysql -u root

use mysql;
insert into user (host, user, passwd, Select_priv , Insert_priv, Update_priv,  Delete_priv,  Create_priv,  Drop_priv) values ('ip', 'user', password('passwd'), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

quit


Replace the 'user' with the user name 'passwd' with the password of the user, 'ip', with the ip address of the client pc which need to connect to mysql and 'Y' to 'N' when appropriate for each of the rights that you allow the client to do.


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question