If your database is located on a different port, you will need to adjust your connection settings within WordPress to connect to it. In this article, we will show you how to define a custom database port within your WordPress configuration.

  1. First, log into cPanel and open the file manager. If you don't use cPanel, you may edit open any text editor you like.

  2. Within the file manager, you will navigate to your wp-config.php file. This file will be located within your root WordPress directory, typically your public_html directory. Right-click it and click on Code Edit.

  3. Now that you have the wp-config.php open, you will want to edit the following line:

    define( 'DB_HOST', 'localhost:3306' );

    As you can see, a port number has been added after the ":". Here, simply add the port number of your database server.

Support Center Login


Social Media Login

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!