Can't connect to a remote database
-
I have been scratching my head for a while now and can’t figure this problem.
2 hosts (websrv and dbsrv) both running CentOS 6.6
I installed WordPress 4.1 on websrv and MySQL 5.1.73 on dbsrv (using yum).
I created my DB:
$ mysql -u root -p mysql> create database wordpress; Query OK, 1 row affected (0.01 sec) mysql> grant all privileges on wordpress.* to 'wp'@'websrv' identified by 'password'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)Then I access the main web page of my new web server, I enter the details for the database (DB name, user, password, etc.) and I get :
Error establishing a database connectionFrom the command line on websrv I can successfully connect to the database using:
mysql -u wp -h dbsrv -p wordpressI also successfully connected with a PHP script :
<?php $db = @mysql_connect('192.168.200.32', 'wp', 'password'); if (!$db) echo "connection failed\n"; else echo "connection succeeded\n";But WordPress won’t connect to the database. What the heck am I missing?
The topic ‘Can't connect to a remote database’ is closed to new replies.