-1

Even though I am root and I can log into my local mysql server as root, the WordPress Setup Configuration prevents me from selecting a database I created:

enter image description here

But I select one of the ones that I did not create like sys, then it seems to connect just fine. What is happening? What am I doing wrong?

edit: Here is what I am inputting into the WP (censoring my password), and this setup configuration generates a wp-config.php file. Again this only seems to work for databases like sys. enter image description here

Flair
  • 2,609
  • 1
  • 29
  • 41

2 Answers2

0

It seems like you are missing the database schema api. You can create it by simply running this query:

CREATE DATABASE api CHARACTER SET utf8 COLLATE utf8_general_ci;

When the schema is created, make sure the user (which you provided on the wordpress page) have all rights on the table. Like this:

GRANT ALL PRIVILEGES ON api.* TO root@localhost IDENTIFIED BY 'your_password';

If you still are experiencing issues, take a look at this post: Can't select database - Wordpress

Mr.Turtle
  • 2,950
  • 6
  • 28
  • 46
  • `ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'your_password'' at line 1` – Flair Nov 19 '18 at 21:52
  • You will have to change `'your_password'` to your actual SQL-password. – Mr.Turtle Nov 20 '18 at 06:34
  • Yes, of course I changed my `your_password` to what I actually put, but I am not going to post that online. – Flair Nov 20 '18 at 17:58
0

I managed to figure out the solution. I follow these instructions (without sudo) in order to completely purge my mysql installation: https://gist.github.com/vitorbritto/0555879fe4414d18569d. By reinstalling my mysql, everything was fixed.

Flair
  • 2,609
  • 1
  • 29
  • 41