Get this error "Error establishing a database connection" every time I try this "

Keywords: WordPress - Windows - Technical issue - Other
bnsupport ID: a2e29bf6-867a-2ab0-2a92-b9d336f6a262
I installed Wordpress on my local win-10 Prof laptop. Had MYSQL installed before starting Wordpress installation. Using root as user name and have not set anything for password. Have assigned port 3307 for MYSQL.
I kept getting the error mentioned in the Title. Thought this might be because of Port. Tried editing my-config modifying the port. However, this did not help.
My Support code is “a2e29bf6-867a-2ab0-2a92-b9d336f6a262”. Please help me resolve this and continue with my work.

Missed mentioning that I edited the Port by setting it to 3308 in Config file. That didn’t help.

Hi @hmashwinkumar,

Thanks for using Bitnami. I see in your bnsupport bundle that MySQL is properly running on port 3308 as you mentioned

2021-04-17T02:06:04.274441Z 0 [System] [MY-010116] [Server] C:\Bitnami\WORDPR~1.7-2\mysql\bin\mysqld.exe (mysqld 8.0.23) starting as process 6204
2021-04-17T02:06:04.473541Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-04-17T02:06:05.342261Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-04-17T02:06:05.740780Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
2021-04-17T02:06:05.881335Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-04-17T02:06:05.882662Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-04-17T02:06:05.955685Z 0 [System] [MY-010931] [Server] C:\Bitnami\WORDPR~1.7-2\mysql\bin\mysqld.exe: ready for connections. Version: '8.0.23'  socket: ''  port: 3308  MySQL Community Server - GPL.

I checked the wp-config.php file and I see the port is 3308 there as well, but I see you updated the database user though (from bn_wordpress to root).

I think this is your problem. Can you verify the database credentials are valid? Hostname, username, password. I also don’t know if using an empty password for the WordPress database is valid. Can you also try using the original database credentials?

Thanks for the response.

First and foremost, I am not a Developer. Please excuse if I ask some basic questions.

I stand corrected on the Post number. Had tried with 3308 But, Mysql runs on 3307 - as shown in the attached screenshot Mysql

As per your suggested I went ahead and set the password for root and gave the DB name too. However, now I get the error “This page isn’t working” every time I try running “”. It appends “wp-admin/install.php” automatically when I run the “/wordpress/” URL.

Have just submitted the logs again and the code is “88d23588-8933-c59a-e7ab-fb740d08da69”. Let me know the way forward, please.


WP Error
This is the error I am referring to in my previous comment.

Hi @hmashwinkumar,

We remove the install.php script as part of the installation process to avoid a warning in the WordPress dashboard. I see you did new changes in the database configuration into the wp-config.php file. I think it is trying to run the installation script because the database you selected is not initialized. Can you restore the default database values, restart services and try again? The database port should be 3308 in DB_HOST according to the MySQL logs.

Have modified the Port number to 3307 now. The default DB name “bitnami_wordpress” was never created. I created a new DB by name “mm” and was planning to use this in my new website. Have made changes accordingly. Can you please let me know why do I still get this error?
Have just submitted the logs - d511f6d5-b2c7-4b47-099a-0c64ded3dc11

Please let me know if we can get into a quick screen-sharing session. Can initiate a Gotomeeting and you can have a look at my setup. That would be much faster.

I am in IST. Let me know your availability at 22:00 Hours IST.

Sending this again as I just got notification on the previous mail bouncing back.

@gongomgra - waited till now before signing off. Request you to let me know if the new logs give more insights into the issue I am facing. Let me know if we can talk any time suitable to you.

Hi @hmashwinkumar,

Thanks for the new bnsupport code. Unfortunately, we can’t provide our users with one on one support via calls, but just posting here in the forum.

Can you tell us why you are trying to use your custom database instead of the one already created by the installer? I still think your issue is caused for trying to use an empty not initialized database. Can you switch to the default one (bitnami_wordpress) and see if it solves your issue?

Hi @gongomgra, Thanks for the response.
I modified the DB details based on the instance I had before installing Wordpress. Do not see any DB by name “bitnami_wordpress” inside my MySQL instance image
I deleted the instance Wordpress created after installation. Thought of configuring the existing one. But, looks like it is not working.
Please let me know if how can I install the DB for my Wordpress instance.


Mysql is running fine on 3306. Have updated the config file with this.

Hi @hmashwinkumar,

I think I’m getting a bit lost here. According to the screenshot you shared, MySQL is running on port 3307. Notice that if you have installed multiple Bitnami stacks in the same server, each installation will be running its own isolated MySQL server. Be careful changing the ports because you may be affecting other apps.

I deleted the instance Wordpress created after installation. Thought of configuring the existing one. But, looks like it is not working.

Can you give me more details on what do you mean with the sentence above? Did you remove the bitnami_wordpress database? If so, I think it is better to uninstall the WordPress stack and install it again. Using the default database should be ok, what are your requirements for using a custom database?

Hi @gongomgra, was thinking of doing just that - reinstalling Wordpress. Let me give it a try and will contact you back if I need any further assistance. Thanks

Hi @hmashwinkumar,

Thanks for your message. I hope the new installation works fine.

Hi @gongomgra, I tried installing again. However, I got the error as attached. Have just submitted logs ced9bd7e-6191-bc12-58cb-199817844290.
Thought of checking with you before making more change and disturbing the set up. Please have a look and let me know.

During the installation it never asks for entering MySQL details. Please let me know if I have to edit the config file.

Hi @hmashwinkumar,

Thanks for the info. I see many installers’ log in the bnsupport bundle. As you have different installations on your server, did you stop them before starting this last installation? Did the installer ask you to set a custom port for MySQL or Apache? Can you share with us the content of the myscript.bat file mentioned?

Bitnami Uninstallation Hi @gongomgra, I uninstalled “1” and made sure this folder “2” was empty before starting new installation. Please refer to the attachment.
Here is the batch script -

@echo off
"C:\Bitnami\wordpress-5.7.1-0/mysql\bin\mysql.exe" --defaults-file="C:\Bitnami\wordpress-5.7.1-0/mysql\my.ini" -u root -e "DELETE FROM mysql.user WHERE User=''; CREATE USER 'root'@'' IDENTIFIED BY '%1'; GRANT ALL PRIVILEGES ON *.* TO 'root'@'' WITH GRANT OPTION;ALTER USER 'root'@'localhost' IDENTIFIED BY '%1';"

Hi @hmashwinkumar,

The script content looks fine. Can you try again using a “simpler” password? You can set a more secure one later in the MySQL command-line interface. I think the password has some weird character is making the batch script fail.

Hi @gongomgra, Have created separate connection for Wordpress and it is working fine. Please have a look at the screenshot attached. Have just uploaded new logs - 0bb1d390-e687-2d77-1fb7-f98285da68b5
Let me know if this gives any better insights.