post

WordPress MySQL Alternate Port

Posted on February 24, 2013 in Advance, Wordpress by admin

By default MySQL port is 3307. Some web hosting companies may use different port for better security. If your MySQL port is something other than 3307, then you will need to define that to your wordpress configuration file, as wordpress will try to connect through port 3307.

It’s pretty easy to let wordpress know your MySQL port.

Open

wp-config.php

Add DB_HOST attribute like following example (change with your own port):

For localhost

define('DB_HOST', 'localhost:3307'); //change with your own port

Other

define('DB_HOST', 'mysql.domain.com:3307'); //change with your own port and mysql server location
 

Leave a Reply