Using digiKam with MySQL

By default, digiKam uses SQLite as its back-end for storing important metadata and thumbnails. But the photo management application also provides support for the popular MySQL database engine, and it comes with a database migration tool that can help you to move your data from SQLite to MySQL. Of course, you might wonder why you’d want to switch to MySQL when SQLite already does a good job of managing the data? Using MySQL as digiKam’s database back-end allows you to store the data on a remote server. This way, you can use multiple digiKam installations (e.g., on your notebook and desktop machine) to access and manage your photo collections. You can also use MySQL tools to back up and analyze digiKam’s data.

Obviously, to use digiKam with MySQL, you need a MySQL server. You also have to create two MySQL databases: one for storing photo metadata (e.g., digikam) and the other for storing thumbnails (e.g., thumbnails-digikam). And before you proceed, note the database connection information such as MySQL server address, user name, and password — you’ll need it when configuring MySQL settings in digiKam.

There are two ways to switch digiKam from SQLite to MySQL. If you’ve just installed digiKam, and you haven’t yet added any collection to it, choose Settings | Configure digiKam, and switch to the Database section. Select the MySQL item from the Type drop-down list.

Enter the IP address of your MySQL server in the Host Name field and specify the correct port in the Port field (the default port is 3306). In the Schema Name field, enter the name of the database for storing photo metadata, and specify the name of the database for storing thumbnails in the Thumbnails Schema Name field. Enter your MySQL user name and password in the appropriate fields. To check whether the database connection works properly, press the Check DB Connection button. If everything works as it’s supposed to, switch to the Collections sections, and add the directories containing your photos. Hit OK, and wait till digiKam populates the databases with data from photos. This can take a while if you have a lot of photos.

If you are already using digiKam with SQLite, you can use the database migration tool to move the existing data to MySQL databases. Choose Tools | Database Migration, and select the MySQL item in the Type drop-down list in the right section. Fill out the required fields as previously described, and use the Check DB Connection button to test the connection. Finally, press the Migrate button to copy the data from SQLite to MySQL.

This would be more useful if it supported the actually raw files itself. I could see digiKam fitting a nice market set where you need multiple people doing work on photos where you could “check out” an image, work on it and return it.

Just putting the metadata and thumbnails up isn’t as useful unless you are looking at tying this into a website or some type of simple client preview system.

MySQL support is all very well, but it seems like Digikam since 1.3 or 1.4 requires it, so I have to build it even if I don’t want to use MySQL backend. I don’t mind optional dependencies, vast majority of KDE people has to have MySQL installed anyway, but not me. Is it intended behaviour (“feature”) or some kind of undesired bug?

What about a PostgreSQL support to ?
Personally I prefer PostgreSQL to Mysql, and I don’t want to install a new SQL server.
This is a very good news but it a could be very very good news if I can use Digikam with my PostgreSQL server

however with this config I get an error at startup about CREATE and TRIGGER privileages not given to user… I checked the password and it is ok…

of course if I setup it to use the root user I have no problems in accessing it… Because some other kde apps share the same mysql server I would prefer digikam to be restricted at accessing only these to databases. Is this possible do I miss somthing?

thank you smith.
I did more or less something similarhttps://bugs.kde.org/show_bug.cgi?id=262321
I would prefer digikamuser to be able to access only its databases and nothing more.
I had a discussion with Bruno see bugs link #c1 and it seems that some changes in digikam are needed to achive this.

I tried this, and a number of other things. On a MySQL 5.0.24a server (on a ReadyNAS Duo). But I’m still getting privilege errors. In particular I get “digikam(3416)/digikam (core): Insufficient rights on databse.”

Very nice! Thank you. After loosing my database about the 4th time (my own fault, I had the database on my nfs-server since my home-dir is over nfs) I decided to give it a try!
I’d advise everyone to store all the metadata directly in the images. It is painfully slow sometimes, but the first time you kill your database you’ll be happy (sometimes my paranoia pays out :-) )

Thank you for bringing me close to solving the problem, but… I use phpMyAdmin as MySQL server on a NAS Synology 212+. Checking the connexion to the database is succesfull. Migrating the database from my computer to the network server is done without a problem. But when I try to add a collection from the directory where are my photo collection on the NAS (through Network>Samba shares), I get the answer “The selected folder does not exist or is not readable”.
Any idea for a solution ?