Connect WordPress with Remote Database (MySQL)

WordPress is a free and open-source blogging tool and a content management system(CMS) based on PHP and MySQL, Where MySQL is a database system used on the WordPress. When we are developing the WordPress website on local server we need to create a new database on our local server to install WordPress or we can also connect a WordPress with remote database.

Here are the steps to Connect WordPress with Remote Database (MySQL) :

Server & Database Details :

We need the following details from server/cPanel/hosting provider,

  • Database Name
  • Database Username
  • Database Password
  • Hostname

Allow Remote Server to Access Our Database :

We need to specific domain name to allow visitors to connect to our MySQL databases by adding IP address/Access Host from which a application is going to run. If you are going to use the database from our local system we need to add our system IP Address or If we need to use on website/server we need to add IP Address of the server.

remote mysql

Connect WordPress with Remote Database :

After we added our Host(For Example : Now our database is ready to connect with the WordPress which is on the Host/IP Address( then we need to add our database details and hostname on wp-config.php

/** The name of the database for WordPress */
define('DB_NAME', 'database_name_here');

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'password_here');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Now, Our WordPress will successfully connected to the remote database. If you have any questions/feedback, Please leave your message on below comment box.

Thank You !!


SIVA SANKAR, Working as a Software Engineer, Blogging is my hobby. I completed my Bachelors of Engineering (Computer Science Engineering) in Chennai, India. and my Master of Engineering (Embedded System Technologies) in Tamilnadu, India.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.