Reply to topic

Guide to running KMyMoney under MySQL

Mike H
Registered Member
Hello all,

Is there a comprehensive guide to getting KMyMoney working with MySQL? I'm running KMyMoney version 4.6.3 with KDE 4.8.5 under Ubuntu 12.04. I've installed the MySQL 5.5 client and server packages and, according to MySQL Workbench and the netstat command, the database software is running OK. However, when I try to save my existing KMM datafile as a database I get this error:-

Cannot save to current database: opening database mysql in function bool MyMoneyStorageSql::createDatabase(const KUrl&)

I've read the stuff in the KMM User Docsabout using a database (chapter 22, if I remember correctly), but nothing has shed any light on what is causing the failure.

Also, when trying to save the file as a database, I see that there is still a warning at the top of the dialogue form that says that the software "is experimental"... is this still true? I thought that the use of MySQL had been around for quite a long time (since version 1.0?).

Any help solving my conversion problem would be appreciated.


Registered Member
I just tried it...

mysql --user=root
create database kmm_test;
grant all privileges on kmm_test.* to 'me';
Save As database...

That seemed to do it for me. There were some issues with saving as a database until I figured out the grant syntax. Some useful debugging notes appeared at the bottom of the error dialog starting with "Cannot save to current database". If you are still having trouble, can you please include the full error dialog? That would help us figure out your problem a little better.

As to the database being backend being experimental: it is stable and you can trust your data with it. Otherwise we would not have made it available to non-developers. You will find that the database backend is noticably slower than the XML backend, but you do not have to worry about forgetting to save, since updates happen as you make them. You also get the ability to grab the nearest computer to you and pull the data, though you could also do this with storing the .kmy file in a shared location.

Good Luck.
Registered Member
Is there any more information on this issue? I'm having the same problem with 4.7.2, and it looks like the answer above is geared toward running the DB on a local server. I'm trying to set up to use one of the databases on my web hosting site.


Kubuntu 14.4 KDE 4.x
You're not prepared to live until you're prepared to die.
Registered Member
Hate to bring up an old thread, but I have this problem as well.

I know the connection to the DB is solid as I use the same SSH tunnel for connecting to my GNUCash database backend. I'm wondering if the MySQL backend for kmymoney has any limitations on host name/port or usernames?

I'm running through an SSH tunnel, and using localhost:3307 (I also tried as that was required for GNUCash) in the host field, and my username has an underscore in it but I'm still not able to connect.

I've both created the database, and manually imported the schema. I also verified all of the permissions on the databases (basically duplicated my gnucash user config and changed the database name) and then flushed privileges.

Any tips on why this cannot connect? I'm assuming at this point it is something with the application and my configuration.

Registered Member
J'utilise KMyMoney-5.0.8-feb8f9e-x86_64.AppImage sous Linux Mint 19.3 Tricia avec MySQL Version 5.7.29-0ubuntu0.18.04.1
L'application fonctionne bien et je souhaiterais sauvegarder mon fichier sous MYSQL.
J'ai créé la base de données KMyMoney vide, j'ai donné les privilèges à l'utilisateur henry sur cette base
Quand je fais enregistrer sous, je choisis SQL et je valide, ensuite je choisis MYSQL , base KMyMoney, utilisateur henry, serveur et mot de passe et je valide
Voila ce que j'obtiens :
(L'opération conduit à la création des tables mais donne le message suivant) :

Impossible d'enregistrer la base de données actuelle : Error in function void MyMoneyStorageSqlPrivate::writeCurrency(const MyMoneySecurity&, QSqlQuery&) : writing Currencies
Driver = QMYSQL, Host =, User = henry, Database = KMyMoney
Driver Error:
Database Error No -1:
Error type 0
Executed: INSERT INTO kmmCurrencies (ISOcode, name, type, typeString, symbol1, symbol2, symbol3, symbolString, smallestCashFraction, smallestAccountFraction, pricePrecision) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
Query error No 1366: Incorrect string value: '\xE2\x82\xA1 ' for column 'symbolString' at row 1 QMYSQL3: Impossible d'exécuter la requête
Error type 2 /home/appimage/workspace/KMyMoney_Stable_Appimage_Build/kmymoney/kmymoney/plugins/sql/mymoneystoragesql_p.h:1471

2-Comme la base est créée j'essaie de l'ouvrir et j'obtiens le résultat suiant :
Base de données apparemment en cours d'utilisation
Ouvert par [email protected] sur 2020-04-20 à 10.57.42.
Ouvrir quand même ?
Je réponds oui et :
Une fenêtre Devises s'ouvre : je fais ajouter, je sélectionne Euro et je clique sur Fermer :
Erreur non interceptée. Merci de rapporter les détails aux développeurs:
Unknown account id 'AStd::Asset' /home/appimage/workspace/KMyMoney_Stable_Appimage_Build/kmymoney/kmymoney/mymoney/storage/mymoneystoragemgr.cpp:142

Merci pour votre aide
User avatar ipwizard
KDE Developer
Bonjour htitus,

fortunately, I have learned French in school many years ago, and I was able to read (and understand) your message. But I don't feel comfortable to answer in French. To many words and most of the grammar have vanished :) J'espère que tu le comprends quand même.

I am not a DB expert and have no idea what could cause your trouble. One thing it may be is the collation used. How did you create the database? See the MySQL online documentation for more details. I am pretty sure that KMyMoney requires UTF-8. \xE2\x82\xA1 is the UTF-8 representation of ₡ which is one of the currency symbols about to be stored in the database. And that failed for some reason.

The second problem you encounter seems to be a follow-up problem as the database is not correctly created (the standard account entries are not created).

Hope that gives some ideas to solve the problem. For sure you need to wipe the tables that were created so you can start afresh.

ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.1 64bit, KF5

Reply to topic


Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], grahm, jmacleod, Majestic-12 [Bot], nrykhe, paleo, rblackwell, Sogou [Bot], YaCy [Bot]