John Moore February 2016

Connecting to a MYSQL Database without using TCP/IP Ports

I'm using VB2010 and MySQL to create a network software solution.

Normally, I'd use port 3306 when creating connections from the program to the database.

DRIVER={MySQL ODBC 5.2 ANSI Driver};SERVER=SERVERNAME;DATABASE=dbname;UID=root;PWD=password;OPTION=3;

Always works fine on my campus, its a local network program, doesn't require external access.

However, is there a way of connecting to a MySQL database without using a TCP/IP port configuration. If I ever need to distribute this software to another site, I may not always be able to get firewall rules changed to allow 3306 through.

Answers


Shadow February 2016

There are 4 ways to connect to a mysql server:

protocol Value  |   Connection Protocol                             |   Permissible Operating Systems
TCP             |       TCP/IP connection to local or remote server |   All
SOCKET          |   Unix socket file connection to local server     |   Unix only
PIPE            |   Named-pipe connection to local or remote server |   Windows only
MEMORY          |   Shared-memory connection to local server        |   Windows only

As you can see, there are other options to connect to a mysql server, but the other methods are either platform specific or cannot be used to access remote servers. Obviously, you can also tunnel the mysql connection through another port. You can use tunneling on both the client and the server side. This latter one is purely a sysadmin / DBA question, so for details I would rather ask on the dba or serverfault sister sites.

Post Status

Asked in February 2016
Viewed 1,171 times
Voted 5
Answered 1 times

Search




Leave an answer