1

I'm working on a little java project and I have a problem. The Mysql-Protocol is blocked by the Firewall and the only ports I'm able to use are 80 or 443. Is there any way to connect to my database over these ports? Acutally I'm using the mysql-connector library for java to connect.

Flex
  • 21
  • 2

3 Answers3

1

You can change the port of MySQL. change the port in /etc/mysql/my.cnf

example :

cp /etc/mysql/my.cnf /etc/mysql/my-3307.cnf
//edit my-3307.cnf, for example
port = 3307
basedir = /var/lib/mysql-3307
datadir = /var/lib/mysql-3307
//end-edit
mysql_upgrade --defaults-file=/etc/mysql/my-3307.cnf #checks the syntax and creates the dirs you need.
#start mysqld
mysqld --defaults-file=/etc/mysql/my-3307.cnf

source : http://dev.mysql.com/doc/refman/5.1/en/multiple-servers.html

PS : 443 is default https port. It is not advisable to use this and 80(http) port.

Prabhat G
  • 2,974
  • 1
  • 22
  • 31
1

Maybe you can change the MySQL port to 443;

But, i think it's bad...

Smember
  • 49
  • 1
  • 1
  • 5
1

I recommend you to setup SSH server on 443 port and use it for tunelling traffic to your database and any other service. Here's how you can tunnel traffic from your local machine to remote database:

ssh -L 9000:localhost:3307 user@1.2.3.4 -p 443

Now you can connect to database, like you have it running locally on localhost:9000. All your traffic to SSH server is encrypted. Check this article for another examples.

You can also check chisel project, however I'm not very familiar with it.

berserkk
  • 987
  • 6
  • 11