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.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

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!