Manage Your Amarok Music Collection with MySQL

Manage Your Amarok Music Collection with MySQL

Amarok is a powerful music player for Linux, Unix and Windows OS with an intuitive interface. It makes playing the music you love and discovering new music easier than ever before – and it looks good doing it! It can be used to organize a library of music into folders according to genre, artist and album. It can edit tags attached to most music formats, associated album art, attach lyrics and automatically “score” music by keeping play count statistics.

Amarok uses an embedded MySQL database to manage music collections. If you don’t want to dump all your local hard drive with large volume of music files and wish to manage your music collections with an external database, then Amarok has a option for that too.

In this article, let us see how to manage music collections with external MySQL database. It will work on all platforms that supports MySQL. Here, I use Ubuntu 13.04 for this tutorial.

Install MySQL

If you haven’t installed MySQL before, install it use the following command:

sk@sk:~$ sudo apt-get install mysql-server mysql-client

During installation, it will ask you to set the password for MySQL root user password. Enter the password twice and continue the installation.

Create MySQL database for Amarok

Let us create a database called amarokdb and database user amarokuser with password ubuntu. Change these values as per your requirement:

sk@sk:~$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.31-0ubuntu0.13.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database amarokdb;
Query OK, 1 row affected (0.01 sec)

mysql> GRANT ALL ON amarokdb.* TO amarokuser@localhost IDENTIFIED BY 'ubuntu';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> exit

Configure Amarok

Open Amarok. Go to Settings -> Configure Amarok -> Database. In the database section click on Use external MySQL database checkbox. Enter the MySQL server IP Address, user and database details and click the Apply button.

Configure – Amarok_020Here is my external MySQL server IP Address. Now add music files to your Library and Enjoy! You don’t have to worry about local disk space now.

9 Comments on this Post

  1. Myriam Schweingruber

    “The default Amarok database uses SQLite to manage music collections …”

    Sorry, but you are very badly informed there. Amarok uses by default an embedded MySQL since the very start of the 2.x series, an external server is only needed if it has to be shared with other people/computers.
    The embedded MySQL is neither slow nor is there any difference in performance with an external server.

    Disclaimer: I am an Amarok Team member

  2. Sorry for the misguide. Thats my mistake. I have updated this how-to now. Thanks for pointing out.

  3. Chris Jones

    Thanks for the information Myriam. I have ammended the article to reflect the correct information regarding Amarok using SQLite.

  4. Myriam Schweingruber

    Sorry, but that amendment is not enough, as the complete article is based on the presumption that the embedded MySQLe is slower than an external MySQL server, and there would be a difference in performance.
    Stating there is a measurable difference between the two is quite a bold statement, can you show some figures? We did extensive tests with very large collections (+500.000 tracks) and there was no measurable difference at all.

    In other words: there are at least 2 wrong statements in that article, if you really want to be taken seriously as a publisher you should research your articles much better IMHO.

    As already explained in my first comment: there is only one reason to use an external MySQL server: when you want to share the database with another user/computer.

  5. Chris Jones

    I am sorry you feel we have given the wrong information Myriam. We base our work off what we know at the time and the information we have at hand. What our Author of this article has shown is simply a method to use a different database to that of what is included in the default Amarok package. Whether it be based on the same database technology or not, we simply show what can be done as an alternative. If you have any more questions, you could always email me at

  6. It is fine to show how Amarok can use an external MySQL, but still the article is still completely misleading, namely these two phrases:

    “When it comes to large collection of music, Amarok will be painfully slow [with MySQL embedded database] when you search through your music collection. So it is better to use external database to manage large collection of music files.”


    “You will notice that there is an improvement in music files search in Amarok library.”

    In fact, the exact opposite is true, using the embedded MySQL database can only be faster, because it allows it to share memory with Amarok instance and avoids any costly IPC.

    Because we already have instructions how to use an external MySQL database with Amarok on our wiki and this article is based on completely false claims, I see no value (more precisely, a negative value) for you to publish it.

  7. We have corrected the points mentioned by you and Myriam. Hope this article doesn’t mislead now.

  8. Thanks for updating the article, it is much better now. On the other hand, still not completely there yet. :-)

    “If you don’t want to dump all your local hard drive with large volume of music files and wish to manage your music collections with an external database”.

    ^^ This sounds like if Amarok put the actual track data into the database, which isn’t the case. Amarok only stores metadata in to database. For example my database consisting of 6000+ tracks has mere 8.5 MB.

    Note that it is well possible to share actual *tracks* among multiple machines, but this is usually done by employing a network filesystem like CIFS or NFS. Amarok has extra code to cope gracefully with network shares (those which are part of the Local Collection folders) becoming available/unavailable.

    Anyways, thanks for popularizing Amarok by writing articles about it.

  9. Seth @ FBT

    Hi Senthil,

    That’s an interesting application of MySQL. Thanks a lot for sharing. I’m gonna try this out now.

Leave a Comment