Changing Your Database Port in WordPress Updated on March 11, 2022 by Jeff Matson 0 Minutes, 49 Seconds to Read 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 about changing your database port within your WordPress configuration. Don’t have time to read our article on changing your database port? Watch our walk-through video. Changing Your WordPress Database Port First, log into cPanel and open the file manager. If you don’t use cPanel, you may edit open any text editor you like. 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. 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. Share this Article Related Articles How to Backup WordPress with the BackWPup Plugin Learn How to Install and Use Mailchimp in WordPress How to Create and Manage 301 Redirects in WordPress How to Add PayPal to WordPress Website Using Video Conferencing with Zoom – WordPress Plugin Create a WordPress News Website with the WP News and Scrolling Widgets plugin Getting Started: Constant Contact Plugin for WordPress Install and Use the Advanced Editor Tools WordPress Plugin The Yoast SEO Plugin: Optimize Your Website to Boost Traffic GiveWP Donation WordPress Plugin