Support » Installing WordPress » Error establishing a database connection

  • I am installing WordPress for the first time on an AIX system.

    I have tried to configure the wp-config.php manually and via the wp-admin/setup-config.php web interface.

    I get “Error establishing a database connection” during the configuration or access of the web page.

      My Database is up

    # mysqladmin status
    Uptime: 257864 Threads: 6 Questions: 93 Slow queries: 0 Opens: 27 Flush tables: 1 Open tables: 10 Queries per second avg: 0.000

      I can connect to it with the specified user from the command line
    $ mysql -h localhost -u dhssql -pThePassWord wordpress
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 38
    Server version: 10.4.25-MariaDB Source distribution
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    readline: warning: turning on OPOST for terminal
    readline: warning: turning on OPOST for terminal
    MariaDB [wordpress]>
      I did add the “define(‘WP_ALLOW_REPAIR’,true);” to the bottom of the wp-config.php file

    AIX v7.1
    Wordpress V6.0.2
    PHP 7.4.30-1
    MariaDB 10.4.26-1

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Rep

    What do you have for DB_HOST in wp-config.php? “localhost” or “127.0.0.1”?

    Thread Starter ggerstner

    (@ggerstner)

    Good Morning

    A very good ask.

    I had localhost.

    It was significantly more happy with 127.0.0.1

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Rep

    Odd, but I’ve run into that before.

    Thread Starter ggerstner

    (@ggerstner)

    I am wondering if it is because “localhost” is an alias in /etc/hosts, not the first entry on the line.
    May have to look at that before the developers get on the system

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Rep

    127.0.0.1 localhost.localdomain localhost is what I have.

    Thread Starter ggerstner

    (@ggerstner)

    Yes, that is typical, a FQDN and then the shortname (which is an alias).

    I did not get to try swapping those around to see what impact it would have. The Dev People were circling like vultures and pounced the moment the site became functional. If i get a moment, I will retry on a sandbox system to see if the combination of AIX/PHP/WP/MariabDB has a sensitivity to the order in /etc/hosts

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.