MariaDB stopped and wordpress Error establishing a database connection

Keywords: WordPress - Installers - Technical issue - Services (Apache, MariaDB, MySQL…)

bnsupport ID: e53b5380-a835-50cf-b0c4-53ac4d3c361e

Description:
i just started using bitnami wordpress installed at my localhost. it working perfectly fine until yesterday mariaDB stopped and not starting anymore with error like this

Starting MariaDB Database...
Exit code: 1
Stdout:

Stderr:
Unknown error starting mysql

been looking for the solution though tall post at community but could not find the solution. here is mysqld.log look like

2021-10-01 14:23:09 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-10-01 14:23:09 0 [Note] InnoDB: Uses event mutexes
2021-10-01 14:23:09 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-10-01 14:23:09 0 [Note] InnoDB: Number of pools: 1
2021-10-01 14:23:09 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-10-01 14:23:09 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-10-01 14:23:09 0 [Note] InnoDB: Completed initialization of buffer pool
2021-10-01 14:23:09 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-10-01 14:23:09 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-10-01 14:23:09 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-10-01 14:23:09 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2021-10-01 14:23:09 0 [Note] InnoDB: Waiting for purge to start
2021-10-01 14:23:09 0 [Note] InnoDB: 10.4.21 started; log sequence number 60967; transaction id 20
2021-10-01 14:23:09 0 [Note] InnoDB: Loading buffer pool(s) from C:\Bitnami\wordpress-5.8.1-0\mariadb\data\ib_buffer_pool
2021-10-01 14:23:09 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-10-01 14:23:09 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-10-01 14:23:09 0 [Note] InnoDB: Buffer pool(s) load completed at 211001 14:23:09
2021-10-01 14:23:09 0 [Note] Reading of all Master_info entries succeeded
2021-10-01 14:23:09 0 [Note] Added new Master_info '' to hash table
2021-10-01 14:23:09 0 [Note] C:\Bitnami\WORDPR~1.1-0\mariadb\bin\mysqld.exe: ready for connections.
Version: '10.4.21-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
2021-10-01 14:23:45 0 [Note] C:\Bitnami\WORDPR~1.1-0\mariadb\bin\mysqld.exe (initiated by: root[root] @ localhost [127.0.0.1]): Normal shutdown
2021-10-01 14:23:45 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-10-01 14:23:45 0 [Note] InnoDB: FTS optimize thread exiting.
2021-10-01 14:23:45 0 [Note] InnoDB: Starting shutdown...
2021-10-01 14:23:45 0 [Note] InnoDB: Dumping buffer pool(s) to C:\Bitnami\wordpress-5.8.1-0\mariadb\data\ib_buffer_pool
2021-10-01 14:23:45 0 [Note] InnoDB: Buffer pool(s) dump completed at 211001 14:23:45
2021-10-01 14:23:46 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-10-01 14:23:46 0 [Note] InnoDB: Shutdown completed; log sequence number 60976; transaction id 21
2021-10-01 14:23:46 0 [Note] C:\Bitnami\WORDPR~1.1-0\mariadb\bin\mysqld.exe: Shutdown complete

2021-10-01 14:24:27 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-10-01 14:24:27 0 [Note] InnoDB: Uses event mutexes
2021-10-01 14:24:27 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-10-01 14:24:27 0 [Note] InnoDB: Number of pools: 1
2021-10-01 14:24:27 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-10-01 14:24:27 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-10-01 14:24:27 0 [Note] InnoDB: Completed initialization of buffer pool
2021-10-01 14:24:27 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-10-01 14:24:27 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-10-01 14:24:27 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-10-01 14:24:27 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2021-10-01 14:24:27 0 [Note] InnoDB: 10.4.21 started; log sequence number 60976; transaction id 20
2021-10-01 14:24:27 0 [Note] InnoDB: Loading buffer pool(s) from C:\Bitnami\wordpress-5.8.1-0\mariadb\data\ib_buffer_pool
2021-10-01 14:24:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-10-01 14:24:27 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-10-01 14:24:27 0 [Note] InnoDB: Buffer pool(s) load completed at 211001 14:24:27
2021-10-01 14:24:27 0 [Note] Reading of all Master_info entries succeeded
2021-10-01 14:24:27 0 [Note] Added new Master_info '' to hash table
2021-10-01 14:24:27 0 [Note] C:\Bitnami\WORDPR~1.1-0\mariadb\bin\mysqld.exe: ready for connections.
Version: '10.4.21-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
2021-10-06  1:01:56 3417 [Warning] Access denied for user 'teditjong'@'localhost' (using password: YES)
2021-10-06  4:01:44 0 [Note] C:\Bitnami\WORDPR~1.1-0\mariadb\bin\mysqld.exe (initiated by: unknown): Normal shutdown
2021-10-06  4:01:45 0 [Note] InnoDB: FTS optimize thread exiting.
2021-10-06  4:01:45 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-10-06  4:01:45 0 [Note] InnoDB: Starting shutdown...
2021-10-06  4:01:45 0 [Note] InnoDB: Dumping buffer pool(s) to C:\Bitnami\wordpress-5.8.1-0\mariadb\data\ib_buffer_pool
2021-10-06  4:01:45 0 [Note] InnoDB: Buffer pool(s) dump completed at 211006  4:01:45
2021-10-06  4:01:46 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-10-06  4:01:46 0 [Note] InnoDB: Shutdown completed; log sequence number 53871342; transaction id 30956
2021-10-06  4:01:46 0 [Note] C:\Bitnami\WORDPR~1.1-0\mariadb\bin\mysqld.exe: Shutdown complete

Hi @teditjong,

Thanks for using Bitnami. According to the error message you posted, it looks like you installed the stack mulitple times on your computer. Is that your case?

I also see there are two different services for the database on your computer

Status   Name               DisplayName
------   ----               -----------
Running  wordpressApache    wordpressApache
Stopped  wordpressMariaDB   wordpressMariaDB
Stopped  wordpressMariaDB-1 wordpressMariaDB-1

Apart from that, I don’t see any error in the MariaDB logs, but I think maybe both services are trying to be started at the same time and this is causing errors. Can you share with us the content of the MariaDB section in the file properties.ini from the installation directory?

Yes, i did uninstall and reinstall Bitnami last week but it still work perfectly fine until 2 days ago.
Here is all the content of properties.ini

[Banner]
disable_banner_file=C:\Bitnami\wordpress-5.8.1-0/apps/bitnami/banner/disable-banner
[MySQL]
mysql_port=3306
mysql_host=127.0.0.1
mysql_root_directory=C:\Bitnami\wordpress-5.8.1-0/mariadb
mysql_binary_directory=C:/Bitnami/wordpress-5.8.1-0/mariadb/bin
mysql_data_directory=C:\Bitnami\wordpress-5.8.1-0/mariadb/data
mysql_configuration_directory=C:\Bitnami\wordpress-5.8.1-0/mariadb
mysql_arguments=-u root
mysql_unique_service_name=wordpressMariaDB-1
mysql_version=10.4.21
mysql_database_type=mariadb
[General]
installdir=C:\Bitnami\wordpress-5.8.1-0
base_stack_name=Bitnami WordPress Stack
base_stack_key=wordpress
base_stack_version=5.8.1-0
base_stack_platform=windows-x64
hostname=
[Support]
installed_components=apache php mysql imagemagick wordpress
apache_logs=apache{,2}/logs/error*log logs/error_log
apache_conf=apache{,2}/conf/{*.conf,bitnami/*.conf} etc/httpd.conf apps/*/conf/ht*.conf
apache_acl=apache apache2
php_logs=php/var/log/php-fpm.log
php_conf=php/{php.ini,etc/php.ini}  php/etc/bitnami/common.conf apps/*/conf/php-fpm/*.conf
php_acl=php
mysql_logs=m{ysql,ariadb}/data/mysql{d,_error}.log var/mysql/*.err
mysql_conf=m{ysql,ariadb}/{my.cnf,my.ini} etc/my.cnf
mysql_acl=mariadb mysql
imagemagick_conf=common/lib/ImageMagick-*/config-*/{log.xml,magic.xml,policy.xml,type.xml}
wordpress_priv=apps/wordpress/htdocs/wp-config.php
[Apache]
apache_server_port=80
apache_server_ssl_port=443
apache_root_directory=C:\Bitnami\wordpress-5.8.1-0/apache2
apache_htdocs_directory=C:\Bitnami\wordpress-5.8.1-0/apache2/htdocs
apache_domainname=DESKTOP-1QU8F7I
apache_configuration_directory=C:\Bitnami\wordpress-5.8.1-0/apache2/conf
apache_unique_service_name=wordpressApache
apache_version=2.4.48
[PHP]
php_binary_directory=C:/Bitnami/wordpress-5.8.1-0/php
php_configuration_directory=C:/Bitnami/wordpress-5.8.1-0/php
php_extensions_directory=C:/Bitnami/wordpress-5.8.1-0/php/ext
php_version=7.4.23
[Imagemagick]
imagemagick_root_directory=C:\Bitnami\wordpress-5.8.1-0\imagemagick

Hi @teditjong,

Can you try stopping Mariadb and restarting it manually?

First open cmd interface with the preloaded environment by clicking on use_wordpress.bat in the installation directory.

Then run this command:

"C:\Bitnami\wordpress-5.8.1-0\mariadb\bin\mysqld.exe" "--defaults-file="C:\Bitnami\wordpress-5.8.1-0\mariadb\my.ini"

Do you get an error message?

Regards,
Michiel

i got this error after tried to run the command

‘“C:\Bitnami\wordpress-5.8.1-0\mariadb\bin\mysqld.exe”’ is not recognized as an internal or external command,
operable program or batch file.

Hi @teditjong.

Did you load the cmd shell with the preloaded environment clicking on “use_wordpress.bat”? Can you check if the path “C:\Bitnami\wordpress-5.8.1-0\mariadb\bin\mysqld.exe” in the command is correct?

Regards,
Michiel

yes i did check the path but inside bin folder i could not find mysqld.exe. it just have mysql.exe

Hi @teditjong,

Thanks for your message. Can you run the command using mysql.exe and share the results with us?

i getting error message after run “C:\Bitnami\wordpress-5.8.1-0\mariadb\bin\mysql.exe”

ERROR 2002 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

maybe should i uninstall and reinstall bitnami so it could work again?

Hi @teditjong,

Can you check that the msqld.exe file exists in the “C:/Bitnami/wordpress-5.8.1-0/mariadb/bin” folder? If so can you try to execute the command again but without quotes?

C:\Bitnami\wordpress-5.8.1-0\mariadb\bin\mysqld.exe --defaults-file=“C:\Bitnami\wordpress-5.8.1-0\mariadb\my.ini”

Regards,
Michiel

sorry there is no msqld.exe in the bin folder

Hi @teditjong,

If that file is missing it would explain why it’s not working. But it’s strange that it disappeared. Did you remember deleting anything? Could you check in the trash bin? Could you send a screenshot of the contents of the MariaDB bin folder?

Regards,
Michiel