简体   繁体   中英

How to use a wordpress Database located on an other server

I need to use a Database locating in an other server for my wordpress site

I changed this on my wp-config.php

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

and in the other computer I changed

Require local in phpmyadmin.conf to Rquire all granted in phpmyadmin.conf file but still i get this error when i try to open my site

Error connecting to the database

What should I do knowing tha im working on windows in both computers

change define('DB_HOST', '192.0.2.100'); to define('DB_HOST', 'localhost');

First of all, you'll need the database host, name, username and password to connect to mysql and not only the host.

Furthermore, make sure the other server allows connecting to mysql remotely (check with your hosting provider). To verify you can use apps like SequelPro to test the connection, and you'll need the following to connect:

  1. Host: database server IP
  2. Username: database user
  3. Password: database user password
  4. List item: Database name (optional if you want to directly select it after successfully connecting)

If you've successfully connected, you'll need to apply these setting in your wp-config.php file:

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

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

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

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

Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM