Solved

Connecting to Port 3306

Posted on 2004-04-10
10
6,516 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
10 Comments
 
LVL 1

Accepted Solution

by:
fyerk earned 20 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 20 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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 20 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 20 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 17

Assisted Solution

by:John Gates
John Gates earned 20 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
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.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

816 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now