So you’ve got a MySQL database server set up and running and you use Amarok for your music. You’d think those two things are quite separate from each other and wouldn’t really combine right?
Now Amarok is a brilliant music jukebox and player and one of its features is that it can use several different types of database to store your music information. One of the database backends it supports is MySQL.
The major benefit of configuring your Amarok to use MySQL instead of the default SQLite is speed. MySQL is a dedicated database system, so if you happen to be running it on your machine anyway (for example if you a have LAMP installation), you may as well take advantage of it.
UPDATE: there is debate as to whether this increases performance or not, but it’s still worth a try. YMMV.
A quick word of warning - this process will involve clearing out your current library, meaning you will lose play counts and other metadata (but not any of your music) from your library when it is recreated in MySQL form.
So the first thing we need to do is create a new database for Amarok to store its data and set up a user to give it access. You do this in the standard MySQL way:
$ mysql -u root -p
Password: [[enter MySQL root password]]
Once you’re logged in, let’s go for it:
mysql> CREATE DATABASE amarok;
Next, let’s create a user and give it permissions to the Amarok DB:
mysql> GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY “amarokPassword”;
Obviously, you’ll want to replace amarokPassword (not including the quotes - keep them wrapped around your password) with a better password of your choice.
Now that’s done, we need to open up Amarok, so do that now. Go to Settings > Configure Amarok and click on Collection on the left.

Select MySQL under Collection Database and enter the username, password and database name that we set up a moment ago. On clicking OK your old collection will disappear and the new one will be built.
If for some reason it won’t rebuild automatically, you can manually kick it into action by going to Tools > Rescan Collection.
And there you go - Amarok, powered by MySQL!


Jamey wrote:
SQLite is *many* orders of magnitude faster than MySQL, are you sure this will make it faster? The only advantage I’m aware of (and reason I personally use the MySQL option) is for networks using the same media library. While there’s a few very rare queries where MySQL is faster than SQLite, I find it hard to see Amarok using any of them.
# Posted on 21-Oct-07 at 9:22 am
lefty.crupps wrote:
Nice, thank you for the simple HowTo.
For those who may want to set it up on Kubuntu Gutsy (7.10) — MySQL installation will prompt you for the MySQL root password. If you’ve not set up MySQL before, this is the one step you’ll be missing from this HowTo, and the system will pretty much do it for you (but you have to provide/create said password).
# Posted on 21-Oct-07 at 9:52 am
Chris wrote:
I noticed an EXTRAORDINARY DECREASE in performance doing this. I was very dissapointed, because Amarok seems a little sluggish, even with SQLite.
# Posted on 22-Oct-07 at 8:24 am
Charlie wrote:
I’ve been using Amarok with PostgreSQL for some time on a rubbishy old laptop and the performance is just fine. Can’t actually remember why I thought it would be advantageous to do this but at least backing up my library metadata is now a mere matter of running pg_dump.
# Posted on 23-Oct-07 at 4:35 pm
tim wrote:
I think there is no question that mysql is faster. Before installing it my screen would turn grey after any change to songs in the playlist, now it is instantaneous.
# Posted on 04-Nov-07 at 2:52 pm
sammael wrote:
same here, switching to mysql immensely sped up amarok. using gutsy
# Posted on 10-Nov-07 at 4:30 pm
matt wrote:
I’ve been using sqlite ever since amarok first appeared but as my collection kept growing (to date the numbers are:10718 songs/61GB) it would literally take several (read many) seconds to search for a particular string until the results would come up. I’ve just made the switch to mysql and it is almost instantaneous, not to mention that scanning/updating the collection really is way faster than used to be with sqlite.
# Posted on 25-Nov-07 at 11:58 pm
Gabriel wrote:
Does this work with remote music collections? I want to have a separate machine with all my music and the mysql server for amarok. I understand how to set the database on a different machine and tell Amarok to use that, but how will I add/remove files to the collection or how do I tell Amarok that the music files are on another machine? sshfs mount only?
# Posted on 28-Nov-07 at 10:18 pm
Ramon wrote:
My music collection is over 300full cds stored on my network. I used SQLlite for awhile, it would take a few seconds to switch cds within my collection and if i ever had to reindex it would take about 45 minutes. I switched to mysql for it and every switch no matter how long it has been is instantaneous. Also a reindex of all of my cds takes a few minutes. I’d very happy I switched. For small collections, I’d stay w/ SQLlite
# Posted on 21-Dec-07 at 12:04 pm
Alexander wrote:
MySql is after my experience WAY faster tham SqlLite when you have a lot (20000+) songs.
On small db the difference is not so obvious and maybe there is even SqlLite faster but i recommend everybody to try MySql when the collection crosses 8000-10000 songs.
# Posted on 01-Apr-08 at 1:56 am
Rama wrote:
There’s a nice compliment to the MySQL solution you have here. Combining both of them works nicely.
Here’s the link to that one: http://ubuntulinuxhelp.com/how-to-speed-up-amarok-part-1/
# Posted on 14-Apr-08 at 3:24 pm
Paul Burton wrote:
Even if it means I have to have MySQL running in the background, having my amarok database run through MySQL is MUCH faster than sqlite, so certainly with a large library (25000+) is really helps
# Posted on 17-Apr-08 at 10:22 pm
srinath wrote:
buddy thnx for ur valuble solution now my “AMAROK” rocks………
# Posted on 09-Oct-08 at 3:47 am