Page 1 of 1

Change MySQL port

Posted: Tue Jul 03, 2007 1:17 am
by tristanlee85
I'm trying to run MySQL on port 23 instead of 3306 due to blocked connections at work. I don't run a telnet server so port 23 is open, but whenever I change the port in my.cnf to port 23, I can't get the MySQL service to start. Is there any way around this?

Posted: Tue Jul 03, 2007 4:26 am
by miro_igov
Are you sure port 23 is free? You talk about mysql service so i assume you run it on windows. Run netstat in the console and see if there is no port 23 in the output.

Posted: Tue Jul 03, 2007 7:03 am
by feyd
Likely, something is bound to it.

Posted: Tue Jul 03, 2007 9:57 am
by Begby
If you are on linux did you change the entry for that port in /etc/services? I think that might make a diff, but I am no linux expert.

Blocked how? If its blocked at the firewall and you are trying to get in through the outside, its blocked for a good reason. I don't think you want port 3306 just out there on the internets for all to see. You would be better off setting up a VPN or something of the sort.

Posted: Tue Jul 03, 2007 1:35 pm
by tristanlee85
miro_igov wrote:Are you sure port 23 is free? You talk about mysql service so i assume you run it on windows. Run netstat in the console and see if there is no port 23 in the output.
I'm using Fedora Core 5. I ran 'netstat' in the terminal and didn't see anything using port 23.

Posted: Tue Jul 03, 2007 1:46 pm
by tristanlee85
Begby wrote:If you are on linux did you change the entry for that port in /etc/services? I think that might make a diff, but I am no linux expert.
I changed it to mysql.

Code: Select all

ftp             21/tcp
ftp             21/udp          fsp fspd
ssh             22/tcp                          # SSH Remote Login Protocol
ssh             22/udp                          # SSH Remote Login Protocol
mysql           23/tcp
mysql           23/udp
Begby wrote:Blocked how? If its blocked at the firewall and you are trying to get in through the outside, its blocked for a good reason. I don't think you want port 3306 just out there on the internets for all to see. You would be better off setting up a VPN or something of the sort.
I run the MySQL server from my apartment. There isn't anything important on this server that will be of any use to anyone so accessing my SQL server from a remote location is the least of my security worries. I don't have the access blocked on my firewall. At work that must not allow outgoing connections to port 3306 because it times out, but if I change my program to connect to port 23, it will allow that.

Currently it works right now. I have the external port 23 re-route to internal port 3306 within my router configuration. That works just fine, but it's very slow due to the routing. That's why I would like to go directly to a SQL server running on port 23 instead of having to router an external port to an internal port. The reason I am choosing port 23 is because it works from work and it's a port that I'm not using here.