Bug 505476

Summary: digiKam 8.6.0 Fails to Use Existing MySQL Database (Works in 8.4.0)
Product: [Applications] digikam Reporter: ALM <alam>
Component: Database-MysqlAssignee: Digikam Developers <digikam-bugs-null>
Status: REPORTED ---    
Severity: critical CC: 70tas, caulier.gilles, jmunoz, metzpinguin
Priority: NOR    
Version First Reported In: 8.6.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description ALM 2025-06-11 13:58:12 UTC
Bug Report: digiKam 8.6.0 Fails to Use Existing MySQL Database (Works in 8.4.0)

Summary:
digiKam 8.6.0 is unable to connect to or use an existing MySQL database that worked perfectly with digiKam 8.4.0. All required components (MySQL server, schema, permissions) are verified and functional, but version 8.6.0 fails to initialize or use the schema.

Steps to Reproduce:
1. Install digiKam 8.6.0 (tested on Windows 11)
2. Attempt to use an existing MySQL database previously created and used successfully by digiKam 8.4.0
3. Configure internal MySQL settings (host: localhost, user: root/test, correct password, port: 3306)
4. Test connection shows “Successful”
5. Click “Finish” to open digiKam

Expected Result:
- digiKam should detect and use the existing schema (digikamcore.Settings etc.)
- Application should launch with full database access

Actual Result:
- digiKam fails to initialize the database
- Stuck at “Starting digiKam” or fails silently
- No meaningful logs, even though schema is intact and connection works

What Was Tried:
- Verified MySQL version compatibility
- Schema from digiKam 8.4.0 confirmed present and valid
- Manually inspected tables (digikamcore.Settings, etc.)
- User has full privileges (GRANT ALL PRIVILEGES)
- Connection test in setup wizard returns success
- libmysql.dll checked — attempted with various versions
- Disabled SSL requirement in MySQL (if applicable)
- Compared logs of 8.4.0 (working) vs 8.6.0 (failing)

Additional Notes:
- MySQL database works flawlessly with digiKam 8.4.0
- Issue started only after upgrading to 8.6.0
- No schema change was made between versions
- It appears 8.6.0 expects additional internal metadata or schema versioning not documented

Suggestion:
Please review:
- Schema compatibility handling from 8.4.0 → 8.6.0
- Internal error logging around MySQL schema initialization
- Whether a migration or new DBVersion in digikamcore.Settings is required
- Provide backward compatibility or schema migration wizard if needed

Environment:
- OS: Windows 11 (22H2)
- digiKam version: 8.6.0 (x64)
- MySQL version: 8.0.x (local server)
- Connection: localhost, non-SSL
- User has admin privileges
Comment 1 caulier.gilles 2025-06-11 14:04:08 UTC
Try to use "127.0.0.1" instead "localhost" in the settings...
Comment 2 ALM 2025-06-11 14:55:48 UTC
(In reply to caulier.gilles from comment #1)
> Try to use "127.0.0.1" instead "localhost" in the settings...

Thanks tried "127.0.0.1" instead "localhost" as suggested but no avail!
Comment 3 caulier.gilles 2025-06-11 15:01:51 UTC
Ah sorry, it's an internal mariadb server not a local server used.

Install debugview and follow the instructions to capture the debug trace from the application at startup:

https://www.digikam.org/contribute/#windows-host
Comment 4 caulier.gilles 2025-06-11 15:04:34 UTC
*** Bug 504717 has been marked as a duplicate of this bug. ***
Comment 5 Maik Qualmann 2025-06-11 15:58:16 UTC
We no longer test with MySQL, only MariaDB. MariaDB is no longer available on Linux, and we only use MariaDB on Windows, too. The DebugView log is urgently needed here to see if we can fix anything.

Maik
Comment 6 ALM 2025-06-11 16:16:42 UTC
(In reply to Maik Qualmann from comment #5)
> We no longer test with MySQL, only MariaDB. MariaDB is no longer available
> on Linux, and we only use MariaDB on Windows, too. The DebugView log is
> urgently needed here to see if we can fix anything.
> 
> Maik

Thanks for the clarification, Maik — that finally makes the issue clear.

I had been using MySQL Server 8.0 with digiKam 8.6.0 (which worked fine with 8.4.0), but ran into repeated schema creation failures and DBVersion errors. After days of troubleshooting, I’ve now fully uninstalled MySQL and will proceed with MariaDB as recommended.

Kindly consider adding a visible notice in the application UI and on the digiKam website/docs stating that MySQL is no longer supported or tested. The setup wizard still lists "MySQL Server" as an option, which is misleading. This cost me over 5 days of retrying every possible configuration, assuming MySQL was still valid.

I appreciate your and Gilles’ clarifications, and I’ll retest using MariaDB 10.6 or 10.11. I’ll share DebugView logs if any issues persist.

Thanks again!
Comment 7 Maik Qualmann 2025-06-11 17:46:00 UTC
A DebugView log of the MySQL error would be really helpful so we can fix it. For an internal MySQL server, only MariaDB can be used, since digiKam manages the server itself. For an external MySQL database, it would still be good if MySQL were working.

Maik
Comment 8 Papadopoulos Anastasios 2025-06-16 16:01:36 UTC
(In reply to Maik Qualmann from comment #5)
> We no longer test with MySQL, only MariaDB. MariaDB is no longer available
> on Linux, and we only use MariaDB on Windows, too. The DebugView log is
> urgently needed here to see if we can fix anything.
> 
> Maik

Maik, MariaDB is available for Linux.  Why do you say it isn't?  I'm having problems setting up DigiKam with MariaDB/MySQL on Linux, but it works with MariaDB on Windows.
Comment 9 ALM 2025-06-16 17:57:45 UTC
I believe it was just a typo—what Maik likely meant is that MySQL isn't available on some specific Linux flavors, although it's generally available on most Linux distributions. However, MariaDB is increasingly being preferred over MySQL, and it's possible that in the future, MariaDB may completely replace MySQL. That’s likely why digiKam is proactively moving toward MariaDB.
Comment 10 ALM 2025-06-16 18:01:02 UTC
(In reply to Papadopoulos Anastasios from comment #8)
> (In reply to Maik Qualmann from comment #5)
> > We no longer test with MySQL, only MariaDB. MariaDB is no longer available
> > on Linux, and we only use MariaDB on Windows, too. The DebugView log is
> > urgently needed here to see if we can fix anything.
> > 
> > Maik
> 
> Maik, MariaDB is available for Linux.  Why do you say it isn't?  I'm having
> problems setting up DigiKam with MariaDB/MySQL on Linux, but it works with
> MariaDB on Windows.

I believe it was just a typo—what Maik likely meant is that MySQL isn't available on some specific Linux flavors, although it's generally available on most Linux distributions. However, MariaDB is increasingly being preferred over MySQL, and it's possible that in the future, MariaDB may completely replace MySQL. That’s likely why digiKam is proactively moving toward MariaDB.
Comment 11 Maik Qualmann 2025-06-17 06:06:52 UTC
Right, that was a typo. MySQL is no longer officially available as a distribution package, at least here on openSUSE Tumbleweed. It might still be available as a community package or directly from Oracle.

Nevertheless, I would like to at least fix this bug and will install MySQL on my Windows test machine.

Maik
Comment 12 Papadopoulos Anastasios 2025-06-17 11:22:43 UTC
(In reply to Maik Qualmann from comment #11)
> Right, that was a typo. MySQL is no longer officially available as a
> distribution package, at least here on openSUSE Tumbleweed. It might still
> be available as a community package or directly from Oracle.
> 
> Nevertheless, I would like to at least fix this bug and will install MySQL
> on my Windows test machine.
> 
> Maik

I installed MariaDB on Linux but, I can't connect to it from another Linux distro;  I can connect to MariaDB from Windows, and some Linux distros, but not OpenSUSE.  Unfortunately, I don't know how to debug it.
Comment 14 Maik Qualmann 2025-06-17 15:46:36 UTC
On openSUSE, the MySQL port (3306) is closed by default through the firewall. Use Yast to open the port.

Maik
Comment 15 Papadopoulos Anastasios 2025-06-17 18:25:47 UTC
(In reply to Maik Qualmann from comment #14)
> On openSUSE, the MySQL port (3306) is closed by default through the
> firewall. Use Yast to open the port.
> 
> Maik

Thanks Maik;  my firewalld is disabled.  I get the following when I try to test the connection:
<<Database connection test was not successful. 
Error was: TLS/SSL error: SSL is required, but the server does not support it QMYSQL: Unable to connect>>
Comment 16 Papadopoulos Anastasios 2025-06-17 19:00:03 UTC
(In reply to Papadopoulos Anastasios from comment #15)
> (In reply to Maik Qualmann from comment #14)
> > On openSUSE, the MySQL port (3306) is closed by default through the
> > firewall. Use Yast to open the port.
> > 
> > Maik
> 
> Thanks Maik;  my firewalld is disabled.  I get the following when I try to
> test the connection:
> <<Database connection test was not successful. 
> Error was: TLS/SSL error: SSL is required, but the server does not support
> it QMYSQL: Unable to connect>>

I installed telnet on my system.  telnet can attach to the port, but for some reason OSS DigiKam does not want to.
Comment 17 Maik Qualmann 2025-06-22 08:19:45 UTC
OpenSUSE has enabled SSL for external MySQL connections in recent updates. You'll need to configure the appropriate SSL connection options in digiKam. Or disable SSL for external MySQL connections.

Here is the bug report that it is intended:

https://bugzilla.opensuse.org/show_bug.cgi?id=1242910

Maik
Comment 18 Maik Qualmann 2025-06-22 08:21:26 UTC
Here is the bug report at digiKam: Bug 503894

Maik