How to use MySQL for Amarok music database

April 19th, 2009 § 2

Amarok is an awesome music program that any tunes junkie should get there hands on.  While I realize that there are a ton of awesome Open Source music players, I just really think that Amarok rocks so I am going to show you a way to make it work even better.  Amarok supports SQLite out of the box, which does its job, but it is not nearly as fast as MySQL in handling large music collections.  I myself have a giant collection, so I need a database engine that can handle the load.  Amarok 2.0 has since been released and it has built-in MySQL support, so no extra setup is necessary.  While this is convenient, the standard repository version of Amarok for most distributions is still, and probably will always be, 1.4 ish.  With that in mind, I am going to give some instructions on how to utilize MySQL for this version.  First off, this guide is for linux users only. Again, my bad.  Secondly, you will need the MySQL server and client packages, which can be obtained with the simple line “apt-get install mysql-server mysql-client” without the quotes of course.  Now that you have the packages you will need to create an Amarok database within MySQL and create a user “amarok” that the program will use to access and maintain the database.  This can be done with the following lines:

$ mysql -p -u root   <<this will get you into the MySQL prompt (you will need to enter the root password that you set up during the isntall process)

now use these lines to set up the database:

1
2
3
4
5
CREATE DATABASE amarok;

USE amarok;

GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'PUT WHATEVER PASSWORD YOU WANT HERE';

That should get you all ready with a shiny new database and database user that amarok will be able to exploit.  Note: obviously you will need to change the password abaove. I used the obnoxious capital message to catch you attention on purpose.

Now that you have a database, you will need to configure amarok so it can utilize it.  Open up amarok and go to Settings > Configure Amarok > Collection.  You should now see a dropdown box that says “SQLite”.  Change that to MySQL and then the hostname should be localhost, the username should and database should be amarok and the password should be whatever you decided to replace the password with in the code above.  Now hit apply and ta-da!, amarok will be using MySQL as its database engine.  Enjoy!

Tagged: ,

§ Leave a Reply

What's this?

You are currently reading How to use MySQL for Amarok music database at Further Down the Rabbit Hole.

meta