When I download a new wordpress from wordpress.org and then paste it into my www folder of WAMP, then create a new database in phpmyadmin, then go to localhost and click the
If using LAMP -
Make sure that all privileges are granted for that database to the created mysql user. Under your MYSQL shell use the below
GRANT ALL PRIVILEGES ON database_name.* TO database_user@localhost IDENTIFIED BY 'user_password';
Where,
database_name = your database name as per wp-config.php
database_user = your user name as per wp-config.php
userpassword = your user password as per wp-config.php
my problem was that when I granted permissions to the DB user the host did not match what was in the wp_config.php
/** MySQL hostname */
define('DB_HOST', 'localhost:3306');
I was granting rights with
GRANT ALL ON databaseName.* TO 'UserName'@'127.0.0.1';
This gave me access when I was connected to the local host through ssh but It did not match wp_config.php. so I had to Grant like this then it all worked.
GRANT ALL ON databaseName.* TO 'UserName'@'localhost';
Verify the wp-config.php file. I had the same error and the problem was related with the quotes: ‘root’ vs 'root'
edit: the correct one is single quote
'
By default
username : root
password : leave it blank
database host : localhost
table_prefix : wp_
please create your database with name 'wordpress' before installing wordpress
It took me way too long to discover that my msql databases were not working on any other websites either. I reinstalled Wamp Server and it worked.