Bug 388345

Summary: AppImage MySQL connection issues
Product: [Applications] digikam Reporter: Quincy <bbc.quincy>
Component: Bundle-AppImageAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin, nick+kde-bug-tracker
Priority: NOR    
Version First Reported In: 5.8.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In: 5.9.0
Sentry Crash Report:

Description Quincy 2017-12-30 02:33:55 UTC
Usually I'm running digikam with MySQL server backend. For testing purposes I tried to use digikam-5.8.0-20171229T043903-x86-64.appimage, but I cannot connect to my database. It works with the very same settings using the conventionally installed version, but not with the appimage. The latter one complains:

-- digiKam AppImage Bundle
-- Use 'help' as CLI argument to know all available options
digikam.widgets: Breeze icons ressource file found
digikam.general: AlbumWatch use QFileSystemWatcher
digikam.general: Database Parameters:
   Type:                     "QMYSQL"
   DB Core Name:             "digikam-appimage"
   DB Thumbs Name:           ""
   DB Face Name:             ""
   Connect Options:          ""
   Host Name:                "localhost"
   Host port:                3306
   Internal Server:          false
   Internal Server Path:     ""
   Internal Server Serv Cmd: ""
   Internal Server Init Cmd: ""
   Username:                 "digikam-appimage"
   Password:                 "XXXXXXXXXXXXXXXX"

digikam.dbengine: Error while opening the database. Error details [ QSqlError("2002", "QMYSQL: Unable to connect", "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)") ]


The installed version goes over this and starts doing it's usual things:

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

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  8
digikam.coredb: Core database: makeUpdates  8  to  8


Indeed there is no MySQL socket at /var/lib/mysql/mysql.sock but at /var/run/mysqld/mysqld.sock (Gentoo standard) which is magically corrected in the installed version.
Comment 1 Maik Qualmann 2017-12-30 06:51:21 UTC
In the AppImage localhost does not work as a server address. Use 127.0.0.1 in the digiKam settings and you can connect to your local server.

Maik
Comment 2 caulier.gilles 2017-12-30 06:54:37 UTC
The installed DK version is which one exactly ?

which Qt version did you use from your system ?

Typically, the socket path is provided by Qt sql backend.

Into AppImage, we use currently Qt 5.9.1.

Gilles Caulier
Comment 3 Maik Qualmann 2017-12-30 07:47:39 UTC
Gilles, I can confirm the problem with localhost in AppImage here under openSUSE. I get the same error message. Currently I am on Qt-5.10.0.

Maik
Comment 4 Quincy 2017-12-30 08:33:28 UTC
Thanks for the quick response! Using 127.0.0.1 indeed solves the problem, but just because it does not connect using the socket at all. If you have a non-networking server (MySQL: "skip-networking") this does not help either.

Therefore to answer Gilles question: digikam 5.7.0 on Qt 5.7.1
Comment 5 Nick Anderson 2018-01-15 22:20:31 UTC
(In reply to Maik Qualmann from comment #1)
> In the AppImage localhost does not work as a server address. Use 127.0.0.1
> in the digiKam settings and you can connect to your local server.
> 
> Maik

Thanks. This worked for me.