Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8314705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:54:46+00:00 2026-06-08T20:54:46+00:00

I am trying to connect wordpress running on my machine to a remote mysql

  • 0

I am trying to connect wordpress running on my machine to a remote mysql database which is tunneled on my machine(localhost). The database connection works by giving following parameters to mysql CLI client

$ 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)

In wp-config.php file of wordpress, I have tried the following values:

define('DB_NAME', 'db_name');
define('DB_USER', 'username');
define('DB_PASSWORD', 'password');
define('DB_HOST', 'localhost');
define('DB_PORT', 10000);

this doesn’t work & throws the following error:

Warning: include(/home/gaurish/Dropbox/code/projects/blog/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /home/gaurish/Dropbox/code/projects/blog/wp-settings.php on line 62 
Warning: include(): Failed opening '/home/gaurish/Dropbox/code/projects/blog/wp-content/advanced-cache.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/gaurish/Dropbox/code/projects/blog/wp-settings.php on line 62 
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/gaurish/Dropbox/code/projects/blog/wp-includes/wp-db.php on line 1038

the last line in the above error(Can't connect to local MySQL server through socket) is gives it away why the connection fails as wordpress is trying to connect through an unix socket.

Now, what parameters I need to set to be able to get wordpress to connect to database way as mysql CLI client?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:54:47+00:00Added an answer on June 8, 2026 at 8:54 pm

    i was able to connect using the following settings in wp-config.php.

    define('DB_NAME', 'db_name');
    define('DB_USER', 'username');
    define('DB_PASSWORD', 'password');
    define('DB_HOST', '127.0.0.1:10000');
    define('DB_PORT', 10000);
    

    the database connection was successful 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying connect to MySQL database from ASP.net code. some my connection is
I am trying to connect to a MySQL 5.5 database as follows: public void
I'm trying to set up WordPress. I have Apache and MySQL running, and the
I'm trying to connect to a remote PostgreSql database using powershell. This is my
I'm trying to connect to MySQL from PHP (WordPress) on Windows / IIS 7.5
I am trying out the following code inside a wordpress template: <?php //connect to
Im trying to connect to a mysql database on my web server, but I
Am trying to connect to a remote system which is not in the same
While trying to connect to a database that's set to read only, the connection
I'm trying to connect to a remote IBM DB2 9.7 database from a java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.