I installed Wordpress using the one-click method. I created a a database using http://localhost/phpMyAdmin/.
I created a database called wordpress
I created a user named wp-admin
I set a password xxxxxxxxxx
User wp-admin has all privileges. The host is set to localhost.
I modified wp-config.php as follows:
define(‘DB_NAME’, ‘wordpress’);
/** MySQL database username */
define(‘DB_USER’, ‘wp-admin’);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘xxxxxxxxxx’);
/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);
Entering localhost/wp into browser results in “Error establishing a database connection.”
Not sure what I’m doing wrong. Any help would be appreciated.
Apparently the original post was difficult to read.
I’m having difficulty configuring wordpress/mysql.
I used one-click to install wordpress, php5 and mysql.
I created the database: wordpress, user: wp-admin using phpMyAdmin
(I’ve tried creating users with host=localhost and host=%)
Browsing to localhost/wp produces the following error message:
Error establishing database connection
Browsing to localhost/wp/wp-admin/install.php produces a similar error message. However, this error message is generated by wordpress.
I think I have the correct db_name, db_user and db_password. I think the problem is the db_host setting.
localhost/wp/wp-config.php indicates:
define(‘DB_HOST’, ‘localhost’);
I just tried (‘DB_HOST’, ‘%’) with the same results.
What is the correct DB_HOST?
I think the problem is a mysql problem, or some other issue and not a wordpress problem.
I inserted the line
echo ‘hello’;
into local/wp/index.php, and hello precedes the “error establishing database connection” message.
I removed the line from index.php and moved it into localhost/wp/wp-config.php. Hello does not display at all. I just get the message about the database connection.
Seems very odd for the application to crash because of a database connection issue before running the commands needed to access the database.
And, yes I did execute ‘systemctl start mysql’ prior to all this.
Did you create the database??
Not sure if I understand you question gogalthrop. I went into phpMyAdmin. Created a database called wordpress and a user named wp-admin. wp-admin was granted all privileges to wordpress. The actual wordpress database is empty.