Solved

Connecting to Port 3306

Posted on 2004-04-10
10
6,517 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
sort command HPUX 11 81
Using Grep to Find a file 8 99
Oracle Finace 3 87
spectrum scale snapshot  resotre/mount 1 12
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 …
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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.

837 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