1

Hello so I installed mariadb today and as soon as I was done installing this error occurred. Now, this sort of makes sense to me because while maria is the replacement for sql I imagine naming conventions and such are still different.

My problem is I have no idea how to go about fixing this issue, can anyone help me out?

This is my part of my config file:

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

/** MySQL database username */
define('DB_USER', 'wpuser');
/** MySQL hostname */
define('DB_HOST', 'localhost');

wp-db.php lines 1533-1537

if(WP_DEBUG) {
   mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
} else {
    @mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags);
}

Edit: Could it be that when I created my sqldb it didn't get carried over? I assumed since Maria is a replacement for sql it would merge my known db upon installation.

Edit 2: there error code and command are different than the one referenced in the other stackover flow question. My issue was that I thought since mariadb is the replacement for sql in it's installation process it would merge any sql db's I had. It turns out this was incorrect and creating a new user,db,pass in maria as well as the mysql_upgrade solved my problem!

Thanks amflare, srayhunter and miken32!

  • 1
    Please add the code from `/var/www/html/wp_includes/wp-db.php` with the relevant lines around line 1534. – amflare Feb 22 '17 at 20:32
  • Identical question in SO [here](http://stackoverflow.com/questions/25174183/warning-mysqli-connect-hy000-1045-access-denied-for-user-usernameloca) – Kishan Oza Feb 22 '17 at 20:33
  • @kishanoza - That is both a different error and a different command. Though, OP, it would not hurt to check the answer given. – amflare Feb 22 '17 at 20:36
  • @kishanoza Yes I saw this question, I thought they might be different because that users issue occurred 'randomly' while mine seems to be a direct occurrence from installing maria. Also the number one response suggests verifying the permissions tables-how would one do this? Also I am only using local host. – Elizabeth Fuenzalida Feb 22 '17 at 20:38
  • @amflare I will do that asap thank you! – Elizabeth Fuenzalida Feb 22 '17 at 20:39
  • @amflare Could it be that when I created my sqldb it didn't get carried over? I assumed since Maria is a replacement for sql it would merge my known db upon installation. – Elizabeth Fuenzalida Feb 22 '17 at 20:54
  • Possible duplicate of [Warning: mysqli\_connect(): (HY000/1045): Access denied for user 'username'@'localhost' (using password: YES)](http://stackoverflow.com/questions/25174183/warning-mysqli-connect-hy000-1045-access-denied-for-user-usernameloca) – miken32 Feb 22 '17 at 20:56
  • 1
    @ElizabethFuenzalida - That is likely. I'm not familiar with the mariadb install process, but I'd be surprised if it could automatically find the databases created elsewhere. – amflare Feb 22 '17 at 21:07
  • 1
    @ElizabethFuenzalida that user wpuser@localhost is either missing in your mariadb or it does not have the correct permissions. My initial thought is that you dont have the user in your db. – Ray Hunter Feb 22 '17 at 23:12
  • @miken32 we discussed this earlier, it's a different error and command than that one; I also checked out that one just in case it provided an answer to my problem and unfortunately it does not. – Elizabeth Fuenzalida Feb 23 '17 at 05:32
  • 1
    `SELECT * FROM mysql.user` will tell you if the user exists. MariaDB can transparently import everything from mysql. Good luck! – miken32 Feb 23 '17 at 05:35
  • 1
    Did you run `mysql_upgrade` after doing the upgrade? – miken32 Feb 23 '17 at 05:36
  • @miken32 I did not! Thank you for that tip! – Elizabeth Fuenzalida Feb 23 '17 at 05:39

1 Answers1

3

Here are the steps to create a user:

  1. Login to your mariadb (terminal): $ mysql -h localhost mysql
  2. Create the user that you need: CREATE USER 'wpuser'@'localhost';
Ray Hunter
  • 15,137
  • 5
  • 53
  • 51
  • So it doesn't carry over from mysql I do have to create a new user,user pass, db,etc.? – Elizabeth Fuenzalida Feb 23 '17 at 05:33
  • 1
    @ElizabethFuenzalida it would not carry over since mariadb is a different db service that is running. You could backup the db and try and restore it to mariadb; however, I am not sure how well that would work for the users. For a db that you created, you would be fine there. – Ray Hunter Feb 23 '17 at 18:32