i tried to install wordpress with XAMPP to my local machine.
I finished the steps of creating database using PHPMyAdmin .
After that,When I'm trying to install wordpress it shows an error as "Error establishing a database connection" when trying to connect http://localhost/wp/ wp is my database which is created on phpmyadmin.
In order to omit the errors while manual installation, you can choose already pre-configured WordPress cluster based on Docker containers that includes replicated databases and scalable servers.
This package can be installed automatically and is production-ready (we use such configuration for our site and blog).
Here is the link to the details and step-by-step instruction.