Store amaroK Data in MySQL

amaroK has the option to store its collection data in a remote MySQL database. Use this feature to create a centralized database of your listening habits so they follow you from computer to computer.

By default, amaroK stores information about your collection including listening habits and rankings into a SQLite database file on your filesystem. If you only use amaroK on a single computer this works fine, but if you run it on multiple computers you might want your information to be persistent across machines. amaroK supports the use of a MySQL database for this type of storage, but it does require a bit of setup beforehand to use. This hack will describe the steps necessary to migrate to a MySQL collection database.

First, you need root access to a MySQL database to create a new database for amaroK. If you plan on accessing this database from anywhere, you will want it to be on an Internet-facing machine that’s always on. Log in to the database as root and create the initial database:

	$ mysql -p -u root
	mysql> CREATE DATABASE amarokdb;
	mysql> USE mysql;
	mysql> GRANT select, insert, update, delete, create, drop, create \
	temporary tables, index ON amarokdb.* TO amarok@localhost IDENTIFIED \
	BY 'password_here';
	mysql> FLUSH PRIVILEGES;

Replace password_here with the password you want to use the for amarok user. Now that the database is created, click Settings → Configure amaroK and then click Collection from the amaroK configuration window. Change the Collection ...

Get Linux Multimedia Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.