Title: WordPress database connection issue, force TCP over localhost
Last modified: August 20, 2016

---

# WordPress database connection issue, force TCP over localhost

 *  Resolved [gary4gar](https://wordpress.org/support/users/gary4gar/)
 * (@gary4gar)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-connection-issue-force-tcp-over-localhost/)
 * Hello everyone,
    I am trying to connect to a remote mysql database which is tunneled
   on my machine(localhost). I use the following parameters to connect to it
 *     ```
       $ mysql --protocol=TCP -P 10000 -h localhost -u username -p'password' db_name
   
       Reading table information for completion of table and column names
       You can turn off this feature to get a quicker startup with -A
       Welcome to the MySQL monitor.  Commands end with ; or \g.
       Your MySQL connection id is 93438893
       Server version: 5.5.8-log Source distribution
   
       Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
   
       Oracle is a registered trademark of Oracle Corporation and/or its
       affiliates. Other names may be trademarks of their respective
       owners.
   
       Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
   
       mysql> show databases;
       +-----------------------------------+
       | Database                          |
       +-----------------------------------+
       | information_schema                |
       | db_name                           |
       +-----------------------------------+
       2 rows in set (1.38 sec)
       ```
   
 * as you notice the above connection works just like normal connection except it
   take the following extra parameters:
 *     ```
       Port = 10000
       Protocol = TCP
       Host = localhost
       ```
   
 * I was wondering how do i set the the above in `wp-config.php`, so wordpress can
   connect to the remote database just like `mysql` CLI client was able to.
 * Let me know, if anyone has any ideas. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-connection-issue-force-tcp-over-localhost/#post-2932458)
 * See [http://codex.wordpress.org/Editing_wp-config.php#MySQL_Alternate_Port](http://codex.wordpress.org/Editing_wp-config.php#MySQL_Alternate_Port)
 *  Thread Starter [gary4gar](https://wordpress.org/support/users/gary4gar/)
 * (@gary4gar)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-connection-issue-force-tcp-over-localhost/#post-2932475)
 * using `127.0.0.1:10000` instead of `localhost` did the trick. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress database connection issue, force TCP over localhost’ is closed
to new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 2 replies
 * 2 participants
 * Last reply from: [gary4gar](https://wordpress.org/support/users/gary4gar/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/wordpress-database-connection-issue-force-tcp-over-localhost/#post-2932475)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
