On my windows dev box mysql is running on port 3306
How can I check what port it is running on the unix server that I have to upload the app to.
|
|
I did
And that indicated that I was using |
||||
|
|
|
MySQL defaults to port 3306 unless you specify another line in the Unless your
Then it is very likely you are using the default port. |
|||
|
|
|
Ok, this works on my linux box, but I'm not sure that Unix will store the cnf file in the same place. cat /etc/mysql/my.cnf | grep 'port' |
|||
|
|
|
If you really want to confirm that it is running on the port you can telnet into the port while the process is up: telnet localhost 3306 You'll see it report that you're connected to mySQL. Alernatively, you can find the process's PID using ps and grep: ps -ef | grep mysql and then put that pid into lsof to print out all the open file descriptors. You'll find the port the process is bound to near the top. |
|||
|
|
|
The best way to actually know what application is listening to which interface and on what port is to use You can do this as root:
It will list out all the listening services like this:
The last column shows you that mysqld bound itself to port 3306 listening on all interfaces. In fact, this works for everything, not just mysql. You can also use it non TCP sockets. |
|||
|
An alternative method to the ones already listed (and not as good but hey, it works).
The uid 27 line is the mysqld process' listening socket, and 0CEA is hex for 3306. |
||||
|
|