Bug 379959 - Could not start database initializer
Summary: Could not start database initializer
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (show other bugs)
Version: 6.4.0
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-17 21:35 UTC by dajomu
Modified: 2020-06-08 03:25 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dajomu 2017-05-17 21:35:10 UTC
Hi,

I always get the error message below when trying to configure digikam 5.5 on Ubuntu 16.10, 17.04, Linux Mint ...

"An error occurred during the internal server start.
Details: Could not start database initializer.
Executable: mysql_install_db
Arguments: --datadir=/home/beda/Pictures/.mysql.digikam/db_data, --defaults-file=/home/beda/.local/share/digikam/mysql.conf
Process error: Unknown error"


I suspect that this might be because digikam tries to initialize using the executable mysql_install_db which is depreciated in mysql5.7
"$mysql_install_db
2017-05-17 23:28:57 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2017-05-17 23:28:57 [ERROR]   The data directory needs to be specified."
Comment 1 caulier.gilles 2017-06-22 21:43:06 UTC
digiKam 5.6.0 is now released and available as bundle for Linux, MacOS and Windows.

https://www.digikam.org/news/2017-06-21-5.6.0-release-announcement/

Can you check if problem still exists with this version ?

Thanks in advance

Gilles Caulier
Comment 2 Hector 2017-07-18 22:58:57 UTC
A similar problem occurs in version 5.6.
Digikam can not connect to the existing database. In order to use the program I had to create a new user and configure from scratch digikam.
So far I've lost 4 years of work. (Labels, albumens, people, etc. I've lost everything !!)

***
En la versión 5.6 sucede un problema similar.
Digikam no puede conectarse con la base de datos existente. Para poder utilizar el programa tuve que crear un nuevo usuario y configurar desde cero digikam. 
Hasta ahora he perdido 4 años de trabajo. (etiquetas, albumens, personas, etc. lo he perdido todo!!)
**
Comment 3 caulier.gilles 2017-07-23 18:27:15 UTC
New digiKam 5.7.0 are built with current implementation as pre-release bundles:

https://drive.google.com/drive/folders/0BzeiVr-byqt5Y0tIRWVWelRJenM

Problem still reproducible ?
Comment 4 caulier.gilles 2017-08-14 12:31:38 UTC
Do you use MAriaDB or Mysql server ? Which version exactly ?

Gilles Caulier
Comment 5 caulier.gilles 2017-12-13 22:42:54 UTC
With next 5.8.0 release Mysql support have been well improved and a lots of
bugs fixed.

Please test with pre release 5.8.0 bundles that we provide and give us a
feedback

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

Thanks in advance

Gilles Caulier
Comment 6 Maik Qualmann 2017-12-14 20:34:09 UTC
The two projects MySQL and MariaDB continue to drift apart. It is becoming increasingly difficult to support both databases. Also, we would have to consider different versions of a database in the future. Maybe MariaDB will replace the program "mysql_install_db" at some point. But I think that in the future we can only support one database. That will probably be MariaDB.

Maik
Comment 7 caulier.gilles 2017-12-14 22:45:32 UTC
I also seen this branching state between these project.

I vote also for Mariadb, which remplace Mysql everywhere de facto under Linux World.

Gilles Caulier
Comment 8 caulier.gilles 2018-08-17 21:34:35 UTC
Can you reproduce the dysfunction using digiKam 6.0.0 pre-release bundle
available here :

https://files.kde.org/digikam/
Comment 9 Michal Kec (MiK) 2018-11-10 16:58:38 UTC
I can confirm this bug affected digiKam 5.9.0 and 6.0.0 beta 2, both on KDE Neon (bionic) and MySQL server 5.7.24.

Besides the issue mentioned in #c0 (mysql_install_db is deprecated), there's another issue caused by wrong parameters order. In according to MySQL docs [1] the argument --defaults-file must be the first. More info about the initializing in MySQL 5.7 on [2]

The initialization command that worked for me was `mysqld --defaults-file=/home/mik/.local/share/digikam/mysql.conf --initialize --datadir=/home/mik/.local/share/digikam/db_data --server-id=1`


[1] https://dev.mysql.com/doc/refman/5.7/en/option-file-options.html
[2] https://mysqlserverteam.com/initialize-your-mysql-5-7-instances-with-ease/
Comment 10 caulier.gilles 2018-12-31 11:51:11 UTC
Can you reproduce the dysfunction using the last digiKam 6.0.0-beta3 just
released ?

https://www.digikam.org/news/2018-12-30-6.0.0-beta3_release_announcement/
Comment 11 ayr035 2019-12-31 18:30:12 UTC
I can confirm this issue still exists in digikam 6.4.0 (on archlinux).

My understanding is that the --defaults-file argument must come before any other option on the commandline in both mysql and mariadb.
Comment 12 Maik Qualmann 2019-12-31 19:23:52 UTC
Works fine with MariaDB here, but of course we can change it.

Maik
Comment 13 Maik Qualmann 2019-12-31 19:32:51 UTC
Git commit 6d386540102043d2c70c98e5b20f24cde6531343 by Maik Qualmann.
Committed on 31/12/2019 at 19:32.
Pushed by mqualmann into branch 'master'.

change order from the "--defaults-file" option

M  +2    -1    core/libs/database/server/databaseserver.cpp

https://invent.kde.org/kde/digikam/commit/6d386540102043d2c70c98e5b20f24cde6531343