ErickBest
ErickBest

Reputation: 4692

WAMP WORDPRESS connects to MySQL but will not connect to MariaDB

Wordpress cannot establish a connection to MariaDB only connects to MySQL Keep getting: Can’t select database How to set Wordpress to connect to MariaDB?

enter image description here

Disabling or Enabling MySQL doesn't help either

enter image description here

This too does NOT work

enter image description here

Here is the PhpMyAdmin database view enter image description here

Upvotes: 1

Views: 1486

Answers (1)

ErickBest
ErickBest

Reputation: 4692

Got it working. I had to set up the sample Config file to look like below and save it as wp_config.php

 // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'wp_db' );

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

    /** MySQL database password */
    define( 'DB_PASSWORD', '' );


#Here is the MOST IMPORTANT of all
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost:3307' );#IMPORTAT: Notice the :3307 that is the PORT for MariaDB


    /** Database Charset to use in creating database tables. */
    define( 'DB_CHARSET', 'utf8' );

    /** The Database Collate type. Don't change this if in doubt. */
    define( 'DB_COLLATE', '' );

And Voila! Somehow I spent days and hours of Googling and banging my head everywhere, but the solution was as simple as that.

Upvotes: 6

Related Questions