Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress Error connecting remote DB

Discussion in 'Misc WordPress Requests' started by Cesare Rossi, Dec 2, 2017.

  1. Cesare Rossi

    Guest

    Error connecting remote DB, by Cesare Rossi

    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).

    web server on 10.15.63.82, db server on 10.15.6.83.

    Permissions for “wordpressuser” on “wordpress” db:

    +———————————————————————————————————————–+
    | Grants for [email protected]% |
    +———————————————————————————————————————–+
    | 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:

    [[email protected] ~]# 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 [email protected]% |
    +———————————————————————————————————————–+
    | 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 , 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’, ‘wodpress’);

    /** MySQL database username */
    define(‘DB_USER’, ‘root’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘VMware1!’);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘10.15.63.83’);

    Error connecting remote DB
     
    #1

Share This Page

Web Hosting