If you want to connect directly to your MySQL database or connect some other application to your database, yous'll need to know the MySQL port, forth with some other data.

The default MySQL port is 3306, so you should be able to apply "3306" as the port for most situations. In this brief article, we'll share more than about how to find the MySQL port and connect to your database. We'll besides answer some FAQs about MySQL and port 3306.

If you're hosting your WordPress site at Kinsta, you'll exist able to admission your database using phpMyAdmin or a direct connexion. Kinsta likewise automatically optimizes your WordPress site's database every week.

MySQL Port FAQs

Let'south showtime past addressing some of the most common questions around the MySQL port.

What Port Does MySQL Use?

MySQL uses port 3306 by default.

What Is the Use of Port 3306?

Port 3306 is the default port used for the MySQL protocol. You'll use it to connect with MySQL clients and utilities such as mysqldump.

Is MySQL Port 3306 TCP or UDP?

The default MySQL port 3306 is TCP(Manual Control Protocol).

Is At that place a MySQL Port Vulnerability? Is It Safe to Open Port 3306?

In general, you shouldnot open port 3306 as it tin make your server vulnerable to attack.

If you lot demand to connect to your database remotely, there are more than secure options than opening port 3306, such as using an SSH tunnel.

If yous must open port 3306, make sure to restrict which IP addresses tin can access it so that information technology'southward not accessible from untrusted hosts.

How to Observe MySQL Port With SQL

Even though the MySQL default port is 3306, that doesn't e'er mean your MySQL service will ever utilise that port. If you desire to verify the port or encounter if MySQL is using a unlike port, yous can notice the MySQL port using a short SQL query.

At Kinsta, you tin can run this query using phpMyAdmin, which you lot can admission from the Kinsta dashboard. Nosotros'll too tell yous how you can remotely connect to a MySQL database in the adjacent section.

In phpMyAdmin, select your database on the left and then become to the SQL tab.

In the Run SQL query box, enter the following:

Show VARIABLES WHERE Variable_name = 'port';

Then click Get:

How to find the MySQL port in phpMyAdmin
How to find the MySQL port in phpMyAdmin

On the next folio, you lot should see the port number in the Value column. Again, the MySQL port is 3306 by default, every bit you tin can run across in the screenshot below:

The MySQL port number after running the query
The MySQL port number afterward running the query

How to Connect to a MySQL Database

If you're hosting at Kinsta, yous can easily access your database from your MyKinsta dashboard using phpMyAdmin. For more than information, bank check out our full post on using phpMyAdmin to access your WordPress database at Kinsta.

Kinsta also supports direct database access if you prefer to utilize other tools such equally TablePlus, HeidiSQL, Sequel Pro, MySQL Workbench, etc.

The most secure method to remotely connect to your MySQL database is with an SSH tunnel. Kinsta provides SSH access on all WordPress hosting plans, so yous tin utilize this secure method to connect to your database.

To connect to a MySQL database using these tools, you will typically need your:

  • MySQL host – learn what it is and how to discover information technology
  • Database username, password, and name – y'all tin find these in your Kinsta dashboard
  • MySQL port – Kinsta uses default port 3306
  • SSH credentials – you tin can discover these in your Kinsta dashboard

For step-by-pace instructions on where to detect this information and how to utilise different tools to directly connect to a MySQL database, you tin follow our directly database admission tutorial.


Salvage time, costs and maximize site performance with:

  • Instant assist from WordPress hosting experts, 24/7.
  • Cloudflare Enterprise integration.
  • Global audience reach with 29 data centers worldwide.
  • Optimization with our born Application Functioning Monitoring.

All of that and much more, in one plan with no long-term contracts, assisted migrations, and a 30-day-money-back-guarantee. Bank check out our plans or talk to sales to notice the program that'due south right for you.