Bug 388422 - DBVersion setting does not exist
Summary: DBVersion setting does not exist
Status: RESOLVED WORKSFORME
Alias: None
Product: digikam
Classification: Applications
Component: Database-Schema (show other bugs)
Version: 5.6.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-01 13:12 UTC by Marcel
Modified: 2020-05-20 08:46 UTC (History)
2 users (show)

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


Attachments
Screenshot of the error msg (23.47 KB, image/png)
2018-01-01 13:12 UTC, Marcel
Details
Error with use of local db (29.44 KB, image/png)
2018-01-02 09:42 UTC, Marcel
Details
Terminal output with digicam 5.8 (83.14 KB, text/plain)
2018-01-02 09:44 UTC, Marcel
Details
Startup log of digikam 5.6 and 5.8 (6.97 KB, application/zip)
2018-01-06 08:37 UTC, Marcel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel 2018-01-01 13:12:21 UTC
Created attachment 109611 [details]
Screenshot of the error msg

I tried setup a my sql database in digikam. The database is located on a  Zyxel NAS 326 using the plugin PHP-MySQL-phpMyAdmin. This plugin has a mysql version of 5.1.73. Connecting to this db is successful on digikam. Tables will be created on the db. 

After a few seconds and on restart of digikam I get the attached error. No albums can be added (correctly according to the api with this error).

What I expect: 
- The button "check connection" must also check such things. 
- A more specific error how to overcome this issue
Comment 1 Maik Qualmann 2018-01-01 17:22:40 UTC
You can test the pre-release appImage from digiKam-5.8.0.

https://files.kde.org/digikam/

Many improvements to MySQL support have been added. The question is, however, whether you have created the database with the appropriate rights? For example:

CREATE USER 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD';
GRANT ALL ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD';
CREATE DATABASE digikam;
GRANT ALL PRIVILEGES ON digikam.* TO 'USERNAME@'%';
FLUSH PRIVILEGES;

Instead of:

'USERNAME@'%'

Maybe also:

'USERNAME@'SERVERADRESS';

Maik
Comment 2 Marcel 2018-01-01 19:42:28 UTC
I tried the following: 
Created a new MySyl db with the given SQL orders for creation (@maik an apostrophe is missing after USERNAME)
Used digikam version 5.8

The issue is the same with digikam 5.8. It does not even give the chance to change the db by gui again. On the terminal is:
-- digiKam AppImage Bundle
-- Use 'help' as CLI argument to know all available options
digikam.coredb: Core database: cannot process schema initialization
QThreadStorage: Thread 0x7f6f4a349600 exited after QThreadStorage 11 destroyed

When I migrate the db the error "Error while creating the database schema." is appearing. 

Same problem for 
'USERNAME@'SERVERADRESS';
"Check connection" returns successful
Comment 3 Maik Qualmann 2018-01-01 19:55:52 UTC
But you have replaced the variables USERNAME, PASSWORD or SERVERADRESS with the settings that you have set in digiKam?

Maik
Comment 4 Marcel 2018-01-01 21:14:36 UTC
Yes I have, otherwise the check connection would not be successful anyway. For the SERVERADRESS I have used my IP address.
Comment 5 Maik Qualmann 2018-01-01 22:20:48 UTC
Is there another error message when you start digiKam in the console? Maybe try and set up a local MySQL server?

Maik
Comment 6 Marcel 2018-01-02 09:42:21 UTC
Created attachment 109622 [details]
Error with use of local db
Comment 7 Marcel 2018-01-02 09:44:15 UTC
Created attachment 109623 [details]
Terminal output with digicam 5.8

Only line 2+3 are shown until the error occurs
Comment 8 Marcel 2018-01-02 09:46:45 UTC
No success with local mysql ether. I uploaded the terminal output and another screenshot of the error. By the way I'm using ubuntu 17.10. Probably that is the reason because mysql is not jet officially supported by this version
Comment 9 Maik Qualmann 2018-01-02 11:23:17 UTC
The problem with the internal MySQL server is known, see bug 379959. MySQL has removed the program "mysql_install_db" Can you test it with MariaDB? In future, we will probably only support MariaDB. In my openSUSE is MySQL already removed.

Maik
Comment 10 Maik Qualmann 2018-01-02 11:27:08 UTC
The error message "QSqlDatabase: driver not loaded" usually indicates a missing package of Qt to support MySQL.

Maik
Comment 11 caulier.gilles 2018-01-02 11:29:57 UTC
I can confirm : Centos and Mageia have also switched to Mariadb.

Note : in my office where we have a ReadHat account, we recieve tips to let's Mysql DB for huge data instead Mariadb. This last one has serious performance problem with huge data storage (more than one Peta bytes by days).

By change, this is not same case with digiKam DB (:=)))...

Gilles Caulier
Comment 12 Marcel 2018-01-03 19:46:24 UTC
How can I install or at least find out witch package is missing of Qt to support MySQL?
Comment 13 Maik Qualmann 2018-01-04 20:43:26 UTC
I think the package is called libqt5sql5-mysql under Ubuntu. Is it installed?

Maik
Comment 14 Marcel 2018-01-04 21:00:52 UTC
The package libqt5sql5-mysql was already installed with the newest version 5.9.1+dfsg-10ubuntu1. 

Marcel
Comment 15 Maik Qualmann 2018-01-04 21:13:40 UTC
If I look at the log of comment 7, something seems to be missing at the beginning. Can you create a new log, the beginning is important. I expect something like this:

digikam.general: AlbumWatch use QFileSystemWatcher
digikam.general: Database Parameters:
   Type:                     "QMYSQL"
   DB Core Name:             "digikam"
   DB Thumbs Name:           "digikam"
   DB Face Name:             "digikam"
   Connect Options:          ""
   Host Name:                "localhost"
   Host port:                3306
   Internal Server:          false
   Internal Server Path:     ""
   Internal Server Serv Cmd: ""
   Internal Server Init Cmd: ""
   Username:                 "maik"
   Password:                 "XXXX"

digikam.dbengine: Loading SQL code from config file "/usr/share/digikam/database/dbconfig.xml"
digikam.dbengine: Checking XML version ID => expected:  3  found:  3
digikam.coredb: Core database: running schema update
digikam.coredb: Core database: have a structure version  9
digikam.coredb: Core database: makeUpdates  9  to  9

Maik
Comment 16 Marcel 2018-01-06 08:37:44 UTC
Created attachment 109703 [details]
Startup log of digikam 5.6 and 5.8

Here are different startup with different db's. With sqlite both versions work fine. With local MySql I get on both a similar error. With Server MySql I get the same error but I'm not able to start digikam 5.8 any more. Digikam 5.6 can be started with an invalid db so the db can be changed again.
Comment 17 Marcel 2020-05-20 07:22:59 UTC
Problem came from the old MySQL Version from the NAS, that can not be updated as it does offer a newer version and has no support for docker. This is not a problem from Digikam, it is a problem from Zyxel.
Comment 18 caulier.gilles 2020-05-20 08:46:53 UTC
Thanks for the feedback

Gilles Caulier