• I have an existing MySQL 8 docker container at localhost:3308 which is working.

    I just pulled the latest WordPress docker image and ran it with
    docker run --name some-wordpress -p 8080:80 -d wordpress

    http://localhost:8080/wp-admin/setup-config.php displays correctly bit will not connect to the MySql instance. The error page gives no diagnostic info so I can’t tell what specifically isn’t working. Just “Error establishing a database connection”

    I set the following:
    Database Name: wordpress (I created a schema called wordpress in MySql assuming “Database” = “Schema”)
    Username: root
    Password: password
    Database host: localhost:3308
    Table prefix: wp_

    The user has full access to the wordpress schema.

    What am I missing/doing wrong?

    • This topic was modified 4 years, 6 months ago by James Huff. Reason: moved to Localhost Installs since this is a localhost install
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Check the PHP error log for any possible additional information. Seems like an odd place for DB errors, but the $wpdb connection object does log DB errors there.

    Double check the DB privileges for the user. Be sure you are checking for the actual wordpress database and not the global privileges. Only when lacking specific database privileges, would the global ones would apply.

    Try resetting the DB password to ensure it matches the one in wp-config.php.

    You’re right, schema == database in mySQL parlance, but outside of that they aren’t exactly the same. “Schema” is more of the conceptual design of data relationships, whereas “database” is the physical manifestation of that schema. May be splitting hairs, but IMHO there is a difference despite how it’s used interchangeably in mySQL.

Viewing 1 replies (of 1 total)

The topic ‘Error establishing a database connection’ is closed to new replies.