Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Speed Up Amarok With Large Music Collections

Amarok is a wonderful application for managing and playing your music collection, but the default settings aren't optimized for speed when it comes to large collections of music. The problems are especially noticeable while trying to use the search box.

The problem is that the default embedded database uses sqlite to store the collection information, which doesn't scale quite as well as a dedicated database such as MySQL… so we'll switch to use that instead.

Configuring MySQL for Amarok

These instructions assume that you don't already have MySQL installed. If you are already using it, then just skip the first couple of steps.

Assuming you are using Ubuntu, run this command from a terminal to install the MySQL server and client on your system:

sudo apt-get install mysql-client mysql-server

For security's sake, you should probably set a root password for your MySQL server using this command:

sudo mysqladmin -u root password "mynewpassword"

You can use the "flush privileges" command or just restart MySQL:

sudo /etc/init.d/mysql restart

Next we'll use the mysqladmin command to create a database for Amarok to use:

sudo mysqladmin -u root -pMyRootPassword create amarokdb

The final command line step will setup the user account for Amarok in MySQL. Make sure to use a different password here.

mysql -u root -pMyRootPassword

> GRANT ALL ON amarokdb.* TO amarok@localhost IDENTIFIED BY 'amarokpassword';

> FLUSH PRIVILEGES;

Configuring Amarok

Open the Amarok configuration dialog via the tools menu and then pick the Collection icon on the left.

image

Change the drop-down to MySQL, and then enter in your details:

  • Hostname: localhost
  • Database: amarokdb
  • Username: amarok
  • Password: password from step above

Close out of the dialog, and then you'll have to rescan your collection to move everything into MySQL, which might take a little while the first time.

Enjoy the speedy searching!

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 11/6/07 and tagged with: Linux

Comments (9)

  1. Kris

    I did this a couple of months back, and it made a dramatic difference. Suddenly I'm again very happy with Amarok.

  2. Henri Gabriel

    The two SQL statements require semi-colons as terminators:

    mysql -u root -pMyRootPassword
    > GRANT ALL ON amarokdb.* TO amarok@localhost IDENTIFIED BY 'amarokpassword';
    > FLUSH PRIVILEGES;

  3. Bert

    Thanks for that last comment; I couldn't get it to work.

  4. The Geek

    Sorry about the confusion on that… updating article.

  5. Bejron

    Dosn't work at all here.
    Got prompted after install to create a password.
    "mysqladmin -u root password "mynewpassword"" didn't work of course since password already was created.
    "/etc/init.d/mysql restart" Didn't wotk wither, "No permisson/access" (running localised version) and then gave up.

    Tried removing and redoing, same result..

  6. drted

    You don't need the mysqladmin -u root password…. step if you set up the root password in the installer.

    on the second command (and subsequent commands in the tutorial), try putting a "sudo" in front of it.

  7. The Geek

    I constantly forget to add sudo before the commands when writing articles… updated.

  8. Atreus

    well you dont need to worry about sudo if you

    sudo su

    when you open your terminal

  9. Atreus

    Oh and I meant to add that your tutorial was very helpful
    a few of the instructions didnt work for me either but then again like previously stated you dont need that line if you already put a password in and I didnt finish that last line but I just used user name as root when i setup amarok and it works great… once again thank you… if it wasnt for people like you then there would be alot of lost people and this operating system wouldnt be as popular as it is now


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.