Error connecting remote DB
-
Hi,
I need to configure WordPress on two servers: one web server and one db server.
Accessing remote db with WordPress is getting my crazy: I always receive “Error establishing a database connection”
I’ve configured and installed all the stuff (LAMP on web server, MySQL on db server). I’ve disabled firewall on both servers.
web server on 10.15.63.82 (centos6), db server on 10.15.6.83 (centosdb).
Permissions for “xxxx” on “wordpress” db:
+———————————————————————————————————————–+
| Grants for xxx@% |
+———————————————————————————————————————–+
| GRANT ALL PRIVILEGES ON *.* TO ‘xxx’@’%’ IDENTIFIED BY PASSWORD ‘*xxx’ |
| GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpressuser’@’%’ |
+———————————————————————————————————————–+Connecting from web server to db server with mysql works fine:
[root@centos6 ~]# mysql -u wordpressuser -p -h 10.15.63.83
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, 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 grants;
+———————————————————————————————————————–+
| Grants for wordpressuser@% |
+———————————————————————————————————————–+
| GRANT ALL PRIVILEGES ON *.* TO ‘xxx’@’%’ IDENTIFIED BY PASSWORD ‘*xxxx’ |
| GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpressuser’@’%’ |
+———————————————————————————————————————–+Checking connections from db server:
mysql> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+—-+—————+—————+———–+———+——+———–+———————————————-+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+—-+—————+—————+———–+———+——+———–+———————————————-+
| 5 | root | localhost | NULL | Query | 0 | executing | SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST |
| 3 | xxx | centos6:57212 | wordpress | Sleep | 160 | | NULL |
+—-+—————+—————+———–+———+——+———–+———————————————-+Always receive “Error establishing a database connection”: no way to solve it.
I’ve changed permissions on /var/ to 777 ??, changed /var/www/html/wp-config.php to:
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress’);/** MySQL database username */
define(‘DB_USER’, ‘xxx’);/** MySQL database password */
define(‘DB_PASSWORD’, ‘xxx!’);/** MySQL hostname */
define(‘DB_HOST’, ’10.xx.xx.xx’);[moderator note: I don’t know if you posted real credentials or not, but I XXX’d them anyway.]
- The topic ‘Error connecting remote DB’ is closed to new replies.