Windows Setup: Error establishing a database connection

I have MySQL 8.0.12, PHP v7.3.2 64Bit and Apache 2.4.38 64Bit installed. In theory I have everything that is needed to run WordPress locally.

Through MySQL Workbench, I have tried the Host, Port, User and Password I have set up in wp-config.php and I am able to connect without any problems.

For some reason however, when I navigate to my site's wp-admin/install.php I get the following:

In my hosts file, I have dev.nativeleaf.co.uk set up to point at 127.0.0.1, along with localhost.

In my php.ini file I have uncommented extension=mysqli and extension_dir = "ext"

I also have done the steps necessary to get Apache dealing with PHP files, e.g. loading the php7_module and the AddType in httpd.conf

I also disabled all Firewalls on Windows, but still nothing! I'm so confused, I don't know why this isn't working.

Any help would be greatly appreciated.

Topic apache local-installation mysql php Wordpress

Category Web


It seems your wp is not connecting with database. There can be some reasons. 1. username, password and host from database are not correct. 2. Check mysql connection in PHP by some small php script for mysql connection.

As you told you have followed #1. Then try to check mysql connection in PHP. There should be mysql mod install in your PHP setup.

In windows try with Xampp.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.