Bug 472841 - Failed to create tables
Summary: Failed to create tables
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (show other bugs)
Version: 8.1.0
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-31 13:59 UTC by Kalle Tuulos
Modified: 2023-08-01 08:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 8.2.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kalle Tuulos 2023-07-31 13:59:01 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1.  Download appimage: digiKam-8.1.0-x86-64.appimage
2.  Create "digikam" user with all rights to "digikam/#" database in external database server running MariaDB in Ubuntu 22.04 computer
3.  Give settings to digikam MySQL screen and press Finish

OBSERVED RESULT
1. Error message with text "Failed to create tables" is given
2. On database server, 20 tables are created:
MariaDB [digikam]> show tables;
+--------------------+
| Tables_in_digikam  |
+--------------------+
| AlbumRoots         |
| Albums             |
| DownloadHistory    |
| ImageComments      |
| ImageCopyright     |
| ImageHistory       |
| ImageInformation   |
| ImageMetadata      |
| ImagePositions     |
| ImageProperties    |
| ImageRelations     |
| ImageTagProperties |
| ImageTags          |
| Images             |
| Searches           |
| Settings           |
| TagProperties      |
| Tags               |
| TagsTree           |
| VideoMetadata      |
+--------------------+


EXPECTED RESULT
Digikam should initialize database and start working properly.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Client computer: Debian 12
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 
Database computer: Ubuntu 22.04
MariaDB version: 10.6.12-MariaDB-0ubuntu0.22.04.1-log 

ADDITIONAL INFORMATION
Database server works fine with other clients using MySQL interface.
Comment 1 Maik Qualmann 2023-07-31 15:49:58 UTC
See this recent Bug 472734 report for solutions. We definitely need the debug log from the terminal.

Maik
Comment 2 Maik Qualmann 2023-07-31 15:50:57 UTC
Check if you also have the rights to create triggers. For triggers, see this Bug 447416 or Bug 435065 as an example.

Maik
Comment 3 Kalle Tuulos 2023-08-01 05:42:09 UTC
I added following on database server:

MariaDB [digikam]> set global log_bin_trust_function_creators=1;
Query OK, 0 rows affected (0.000 sec)

This solved the problem and now Digikam works fine.

Could this be added to Digikam's startup documentation?
Comment 4 Maik Qualmann 2023-08-01 06:23:31 UTC
Git commit 9ed1deb785ce30f316f89fc7c38daee126d5ec60 by Maik Qualmann.
Committed on 01/08/2023 at 08:21.
Pushed by mqualmann into branch 'master'.

add note for MySQL server on Ubuntu
Related: bug 472734
FIXED-IN: 8.2.0

M  +1    -1    NEWS
M  +3    -0    core/libs/database/utils/widgets/dbsettingswidget.cpp

https://invent.kde.org/graphics/digikam/-/commit/9ed1deb785ce30f316f89fc7c38daee126d5ec60
Comment 5 caulier.gilles 2023-08-01 08:55:53 UTC
Git commit 1108d12b65fec2d7320acac8f32290b85a7660b7 by Gilles Caulier.
Committed on 01/08/2023 at 10:53.
Pushed by cgilles into branch 'master'.

digiKam online doc: add note about Mysql under Ubuntu which need additional sql code to create triggers.

M  +8    -0    setup_application/database_settings.rst

https://invent.kde.org/documentation/digikam-doc/-/commit/1108d12b65fec2d7320acac8f32290b85a7660b7