Bug #109438 MySQL installation stuck on "Initializing database (may take a long time)"
Submitted: 20 Dec 2022 15:17 Modified: 23 Dec 2022 6:45
Reporter: Theresa Lau Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:8.0.31 OS:Windows (Windows 10)
Assigned to: CPU Architecture:Any

[20 Dec 2022 15:17] Theresa Lau
Description:
MySQL installation stuck on the 4th step: Initializing database (may take a long time). 
Although I tried to uninstall any times and reinstall back, it still happens. Even version 5.7.40 failed. 
Also, the first error I got is in the catalog. It show need to apply upgrade, but failed to upgrade.

How to repeat:
Beginning configuration step: Writing configuration file

Saving my.ini configuration file...
Saved my.ini configuration file.
Ended configuration step: Writing configuration file

Beginning configuration step: Updating Windows Firewall rules

Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 3306" protocol=TCP localport=3306

Deleted 1 rule(s).
Ok.

Adding a Windows Firewall rule for MySQL80 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow
Ok.

Successfully added the Windows Firewall rule.
Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 33060" protocol=TCP localport=33060

Deleted 1 rule(s).
Ok.

Adding a Windows Firewall rule for MySQL80 on port 33060.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow
Ok.

Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules

Beginning configuration step: Adjusting Windows service

Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Updating existing service
Existing service updated
Ended configuration step: Adjusting Windows service

Beginning configuration step: Initializing database (may take a long time)

Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.31...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
Using jemalloc.dll for my_malloc and ut::malloc etc.
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Empty value for 'open_files_limit' specified.
Process for mysqld, with ID 10800, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.31.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)
[21 Dec 2022 11:56] MySQL Verification Team
Hello Theresa Lau,

Thank you for the bug report.
I tried to reproduce your issue on windows 10 with MySQL Server 8.0.31 but I am not seeing any issues at my end. 

Regards,
Ashwini Patil
[21 Dec 2022 11:57] MySQL Verification Team
8.0.31 test results

Attachment: 109438_test_results.PNG (image/png, text), 131.40 KiB.

[21 Dec 2022 13:07] MySQL Verification Team
Hi,

This is a problem with jemalloc library, which is very well known. So, those who do not have that library installed, do not experience any problems.

Hence, this is a bug in jemalloc.dll library, which is not maintained by us, at all.

The workaround is to stop MySQL server, rename that library and start it again.
[21 Dec 2022 16:46] Theresa Lau
Hi, can you explain in more details what should I do to the jamalloc.dll?
[22 Dec 2022 13:21] MySQL Verification Team
Rename it !!!!
[23 Dec 2022 6:45] Theresa Lau
I have rename the jemalloc.dll in My SQL file, but still failed.

Beginning configuration step: Writing configuration file

Saving my.ini configuration file...
Saved my.ini configuration file.
Ended configuration step: Writing configuration file

Beginning configuration step: Updating Windows Firewall rules

Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 3306" protocol=TCP localport=3306

Deleted 1 rule(s).
Ok.

Adding a Windows Firewall rule for MySQL80 on port 3306.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow
Ok.

Successfully added the Windows Firewall rule.
Attempting to delete a Windows Firewall rule with command: netsh.exe advfirewall firewall delete rule name="Port 33060" protocol=TCP localport=33060

Deleted 1 rule(s).
Ok.

Adding a Windows Firewall rule for MySQL80 on port 33060.
Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow
Ok.

Successfully added the Windows Firewall rule.
Ended configuration step: Updating Windows Firewall rules

Beginning configuration step: Adjusting Windows service

Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Updating existing service
Existing service updated
Ended configuration step: Adjusting Windows service

Beginning configuration step: Initializing database (may take a long time)

Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.31...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1...
jemalloc.dll not found. Falling back to default malloc.
C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Empty value for 'open_files_limit' specified.
Process for mysqld, with ID 16920, was run successfully and exited with code 1.
Failed to start process for MySQL Server 8.0.31.
Database initialization failed.
Ended configuration step: Initializing database (may take a long time)
[23 Dec 2022 12:26] MySQL Verification Team
Hi,

This is different problem. Nothing to do with malloc library.

Your configuration file is simply wrong and has errors ....

Consult our Reference Manual.