• Spent whole to figure this out. I want to separate DB server and wordpress web server.

    I am 200% sure the parameters following are correct. However, i am still getting “Error establishing a database connection” during installation. Besides, i installed mysql client on wordpress web server and i can login mysql server remotely with same username and credentials. But the wordpress installation scripts always give me error messages.

    define(‘DB_NAME’, ‘wordpress’);
    define(‘DB_USER’, ‘root’);
    define(‘DB_PASSWORD’, ‘root’);
    define(‘DB_HOST’, ‘ip’);

    Any suggestions?

    Thanks
    Fan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Fan,

    Please make sure that the remote server where you hosted your database have added the wordpress server’s IP as remote IP from the CpPanel.

    We can’t access any database from any other server even if we are connecting through WordPress.

    Thread Starter pop3165

    (@pop3165)

    Hi GeethuV,

    Yes. i have added following in Mysql DB server to allow remote access

    GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY “root” WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    From wordpress application server, I was able to login through mysql client. I think the remote access is working fine. I don’t have GUI access to wordpress server so CpPanel is not an option to me.

    mysql -h db-ip -u root -p

    Besides, when i look the apache server log on wordpress server. It has following error

    Permission denied in /var/www/html/wp-includes/wp-db.php on line 1538

    Any guidance?

    Thanks
    Fan

    Hi Fan,

    Please make sure that you have provided enough permissions to all the files and folders of the site.

    All folders should have 755 permission and files should have 644.

    Please change the permission and check again.

    If still it’s not working, please re-upload the ‘wp-includes’ and ‘wp-admin’ folders (and also the root files except wp-connfig.php’) from the fresh WordPress download.

    Regards,
    [ Signature moderated ]

    Hi,

    same problem here. web server on 10.15.63.82, db server on 10.15.6.83.

    Permissions for wordpressuser on WordPress db:

    +———————————————————————————————————————–+
    | Grants for wordpressuser@% |
    +———————————————————————————————————————–+
    | GRANT ALL PRIVILEGES ON *.* TO ‘wordpressuser’@’%’ IDENTIFIED BY PASSWORD ‘*16907081F70B954E79743DA4F785043069E9D33F’ |
    | 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 distribution

    Copyright (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 ‘wordpressuser’@’%’ IDENTIFIED BY PASSWORD ‘*16907081F70B954E79743DA4F785043069E9D33F’ |
    | GRANT ALL PRIVILEGES ON wordpress.* TO ‘wordpressuser’@’%’ |
    +———————————————————————————————————————–+

    Always receive “Error establishing a database connection”: no way to solve it.

    I’ve changed permissions on /var/ to 777 🙁

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Separate DB server Installation with “Error establishing a database connection”’ is closed to new replies.