Check the port in which the Mysql is running on


Mysql can be configured to run other ports other than the default port (of 3306). So what will you do when you need to find the port on which a mysql server runs on. If you don’t have access to the server files and can access the server only using the mysql client, the only way to know this is by checking the Global Variable set. We can see all variables by issuing the command:

 SHOW GLOBAL VARIABLES;

But this will give you a huge list of necessary and unnecessary values. So if we know what we want ( like for now we want the Port on which it is running) we can use the LIKE command along with it. LIKE will get you variables that have the keyword specified in its name.
Hence to get the port number on which the mysql is running by the command:

 SHOW GLOBAL VARIABLES LIKE 'PORT'; 

Which shows result as:
+——————-+———+
| Variable_name  | Value    |
+——————-+———+
| port                      | 3336      |
+——————-+———+
Hence the port which this mysql is running on is 3336.


, , , , , , , ,

  1. #1 by xyz on June 25, 2010 - 2:25 pm

    You can do that by simply running the command
    nmap .

  2. #2 by Srijith R on June 25, 2010 - 5:08 pm

    Actually this is intended when there is more one mysql instance running in the system. Or when you there in the mysql client and just need to check the port running

  3. #3 by Betting Promo Codes on October 18, 2013 - 12:51 am

    Everything is very open with a clear explanation of the challenges.
    It was truly informative. Your website is useful.

    Thanks for sharing!

  4. #4 by dejanzdr on January 3, 2014 - 8:51 am

    Thanks for sharing.

  5. #5 by CSR Racing APK on August 9, 2014 - 8:57 pm

    I’m impressed, I must say. Seldom do I encounter a blog that’s both educative and engaging,
    and without a doubt, you have hit the nail on the head.
    The issue is an issue that not enough men and women are speaking intelligently
    about. I am very happy that I stumbled across this during
    my search for something concerning this.

  6. #6 by Ramona on September 16, 2014 - 6:26 pm

    Article writing is also a excitement, if you be familiar with after that
    you can write otherwise it is difficult to write.

(will not be published)