Changing Database Port of WordPress Website

Changing Database Port of WordPress Website

WordPress uses MySQL as its database by default. When you start using WordPress, the database port will be set to something by default by the hosting provider. In most cases, you don’t have to worry about finding it out or changing it. But in other instances, changing database port of your WordPress seems both logical and necessary. For example, if you want to prevent port scans carried out by port sniffing websites, it’s a good idea to have your port changed. In this guide, learn how to change database port of WordPress websites.

Step-by-Step Process

To begin with, you’d need cPanel credentials, FTP software, and a text editor. Once done, follow the steps mentioned below:
  • Log in to your cPanel dashboard
  • Navigate into the WordPress directory under the File Manger. Or else, you can also connect to it via FTP
  • Click and open File Manager.

  • You’ll see a list of files and folder. You need to find and open the public_html folder and access the wp-config.php file
  • Right-click on wp-config and click on Edit
  • Search for ‘DB_HOST’. It should list the port number, which by default, is 3306. Change it to other port number of your choice

  • Click on Save Changes
So that’s how you change the database port number of your WordPress website.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma