I’m trying to install wordpress on my localhost with XAMPP. My Apache module is on ports 80,443 and my MySQL module is on port 3307 (default is 3306). I can’t start installing wordpress. After entering localhost/wordpress in my browser there apears error "Error establishing a database connection". I don’t have wp-config.php file i guess it creates after starting installation which i can’t start
I tried changing wp-config-sample.php but it looks like it doesn’t change anything i also tried creating wp-config.php on my own and changing DB details there
2
Answers
You have to change config.php not config-sample.php.
That’s all you need. Just append ":" after localhost (or your machine ip address/host name)
Having a database connection issue would mean there’s a "wp-config.php" file being used, and the credentials are incorrect — hostname, port, credentials, or possibly not having a database created yet.
During an initial setup, WordPress will create the wp-config.php file with the MySQL credentials, when the connection is a success. If you’re not getting a setup page, review your "wp-config.php" file, or delete all of the contents and start over with a new WordPress download. Extract the zip/tar.gz archive, and move the contents in the "wordpress/" folder into your site’s DocumentRoot.
You can also test your MySQL credentials with this command:
The uppercase "P" is for port, and the lowercase "p" is for password. If entering the password at the prompt is successful, check that you’ve got a database with
show databases;
.