Solved

Connecting to Port 3306

Posted on 2004-04-10
10
6,514 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
Comment Utility
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 61

Assisted Solution

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

Author Comment

by:RICHARDH
Comment Utility
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
 
LVL 61

Expert Comment

by:gheist
Comment Utility
This is unsafe, so read TFM to find out all insecurity you want to open...
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Assisted Solution

by:pixr99
pixr99 earned 20 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

772 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

10 Experts available now in Live!

Get 1:1 Help Now