Wednesday, 2 January 2019

Worpress Error establishing a database connection IIS10

I'm trying to setup WordPress with MySQL on my local Windows 10 machine. I'm getting this error:

Error establishing a database connection This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost:3307. This could mean your host's database server is down.

I already checked here: Error establishing a database connection on wordpress

  1. Are you sure you have the correct username and password?
    Yes, I can login to SQL Server Workbench with the root credentials, so that is working
  2. Are you sure that you have typed the correct hostname?
    That's what I'm trying below
  3. Are you sure that the database server is running?
    Yes, checked in MySQL workbench and it's running

I ran this query select @@hostname which gives me: DESKTOP-CFT2ESY

I tried adding to wp-config.php:

define('DB_HOST', 'localhost:3307');
define('DB_HOST', 'localhost:8899');
define('DB_HOST', 'localhost');
define('DB_HOST', 'DESKTOP-CFT2ESY');

None of these work, it just changes the hostname string in the above error message.

I then added: define('WP_ALLOW_REPAIR', true);

But that does not change the error message at all.



from Worpress Error establishing a database connection IIS10

No comments:

Post a Comment