Is it possible to host wordpress database from other server
Asked Answered
F

2

7

I've a problem is that I've to host wordpress database from other server and directory from another server where my domain links, so is it possible to connect wordpress directory from other database which is not on same server, kindly resolve my issue if know the answer. Thanks in advance.

Fugacity answered 19/9, 2016 at 9:37 Comment(0)
D
13

Yes, as long as the MySQL server allows the database to be accessed by external servers. When you set up WP, instead of "localhost", you'll put in the SQL server.

you can export the current database, then you will create a database on another server,

then instead of "localhost" (in the config.php ) you will put the IP address of the server and then the config.php will connect

// wp-config.php

define ( 'DB_NAME', 'yourdbname' );
define ( 'DB_USER', 'yourusername' );
define ( 'DB_PASSWORD', 'yourpassword' );
define ( 'DB_HOST', '111.222.0.1' ); // IP address of the server where MySQL is running 

// make sure MySQL server will listen to the request from your WP server IP !

https://forums.digitalpoint.com/threads/can-i-host-wordpress-database-in-an-other-server.2702115/

Deirdredeism answered 19/9, 2016 at 9:51 Comment(4)
Thanks Raj kumar for your helpFugacity
Welcome, sir ! enjoy itDeirdredeism
I get solution by adding port after my db_host Like 111.222.0.1:3306Velasquez
It's possible set a name to external IP in /etc/hosts for Linux. After this, you can do define( 'DB_HOST', 'domain.name' ); and get same result but more human readable.Stinko
F
-2

In config.php file you just put ip address of other server where your database exist instead of localhost. but remember it's not good idea to run separately database and source files, it will make you in trouble , for more info just view the following link. Thanks for you cooperation.

https://forums.digitalpoint.com/threads/can-i-host-wordpress-database-in-an-other-server.2702115/

Fugacity answered 19/9, 2016 at 9:53 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.