I found myself complaining about the slow speed of Amarok. Everything would lag, from playing a song to adding a song to the playlist. Then i remembered when I was setting up Amarok that it let me chose a database, and said the faster ones required extra set up. Of course, I chose the no set up required but slow speed option (SQLlite).
Now, I wanted to switch. And boy am i glad. Everything works as fast as it should.
sudo apt-get install mysql-server mysql-client
now this (replace PASSWORD with your password)
mysqladmin -u root password PASSWORDthen this
mysql -p -u root
CREATE DATABASE amarok;
USE mysql;
GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'PASSWORD_CHANGE_ME';
FLUSH PRIVILEGES;
quit
In Amarok, go to settings> configure Amarok
Click Collection
Select MySQL.
Use the following settings:
Hostname: 127.0.0.1You're done! Enjoy the speediness!
Database: amarok
Port: 3306
Username: amarok
Password: Your Password
Problems? check out the official wiki:
http://amarok.kde.org/wiki/MySQL_HowTo
61 comments:
hi,
when i run apt-get, it can't find the libmysqlclient12-dev...
also, what should i put instead of the 'password_change_me' field? my root password?
hm... i just did a search myself and could not find it... but it still works.. let me know how it works for you
oh and yes, replace that with the password you will enter in amarok settings (not necessarily your root password)
Have you made sure you are actually running Amarok 1.4.7 and not the one that comes with a stock Ubuntu install? That it should be this slow sounds a lot like your installation is older - according to tests done by one of our devs, SQLite should be as fast as MySql for anything up to at least ten thousand of tracks now. Please check it :)
Great article to chat about!
Does it have a PostgreSQL option? I'd rather use a better database than MySQL - especially since I and most of my more durability-obsessed friends already have PostgreSQL set up.
Dude I love postgreSQL as much as you but seriously, if this isn't a time when myISAM is the better tool for the job, then I don't know what is. Pgsql is simply overkill here.
And how do i revert all the process?
When I set up Amarok, it already had localhost in the host field. I figured that would work. It did not - Amarok gave me a strange error. I fixed it by using 127.0.0.1 - ?!
Heh. Personally, I feel like if you care about your data enough to run a database at all, PostgreSQL isn't overkill, it's a baseline. However - we're getting off topic. The question was whether Amarok supported PostgreSQL. Anyone know?
yes, there is an option to use PostgreSQL. Since we are talking thousands of records here, I don't think PostgreSQL is overkill (if MySQL isn't overkill then it isn't either) at all. Especially if you have PgSQL set up somewhere and you don't want to deal with the horrible mess that is MySQL.
postgresql support page:
http://amarok.kde.org/wiki/PostgreSQL_HowTo
It mentions how to support different users with schemas, a topic not touched on in the MySQL howto.
Wow, I'm fairly new to Ubuntu and this is one of the first times everything has gone smooth. I don't want to debate over db semantics, just wanted to comment that your instructions were straight forward and results are noticeable.
Thanks!!
Hi Mike,
As a Linux noob, your instructions were flawless. As I have a large music collection, this has been something that I have wanted to do. Thanx.
is this the reason people should choose to switch to linux?
is this the reason people should choose to switch to linux?
no. this is the reason, why people should reconsider using Amarok.
mysql sucks, postgresql rules :)
Thank god for this post. At 28,000 tracks Amarok was hardly usable; now it speeds along like the rest of my system.
Canadian Pharmacy - We offer a wide selection of the most popular medicines online.
This post preserved another amarok user. I was about to ditch it for another media player until this post noticeably speeded it up. Thanks :)
I could not make amarok work using your instructions. I found that I had to enter the username as "root" in amarok, instead of user "amarok." Otherwise the instructions worked. I don't know if it matters, but I am using amarok under Gnome.
I ditched Amarok a while back and was using Exiale but it suffered similar performance problems.
I decided to try Amarok again and through the install process was reminded about the backend DB options, I found the instructions when the built in link for MySQl was not working - talk about simplifying the process. Thanks Mike - its literally 5 min later and I'm rockin' out right now!
Simple instructions to achieve a goal in minimal time. Awesome.
After running through this, I decided to go with PostgreSQL anyway, and I have to say it's light years faster than SQLite and noticeably faster than MySQL.
My library is greater than 8000 tracks. I would recommend to everyone with 8000+ tracks to give PostgreSQL... it's far superior.
I run Gutsy and have a library around 15,000 songs. Amarok runs MUCH more smoothly now. Thank you!
Thanks very much for your blog, but I must say that it wasn't very concise. I'm not sure where you got your "use these settings" from, but they certain;y didn't work for me. Your blog deviates from the official instructions for enabling MySQL with Amarok: http://amarok.kde.org/wiki/MySQL_HowTo#MySQL_Setup
Though you do provide help with installing the program via the Terminal, your instructions for setting up and implementing MySQL were a little flawed.
Thanks anyway though...
i get this error
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
and i opened that folder and i dont see the .sock file,
any idea what i should do now?
i would really appreciate if u could get back to me
THANKS A MILLION
In Amarok Collection Configuration, you must put:
"Hostname: Localhost"
Putting an IP will give you an user/pass error
Awesome howto!
Worked perfectly!
A million thanks =D
hi, i get the following error after i run the 2nd command...
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
hi, i get this error when i run the 2nd command...
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
thanks in advance
These are very simple and straight forward instructions. Thanks! Also on a similar note, mySQL is a great DB. I use it for several different purposes from website use to personal budgeting. I've never had any problems with it. I am curious (since I have not yet tried postgreSQL), why do some users prefer this over mySQL?
Hi,
I get this same error...
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
Anyone have any ideas of resolving this?
Thanks
Mike,
you are awesome dude. This cant be simpler. I have read other How-tos too but could never configure MySQL for Amarok.
You Rock.
Thanks,
God bless you.
Rakesh Gupta
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/
stream, skip that second command. worked fine for me without it. got the same messg as you.
mike, thanks for the tutorial.
I'm running Gutsy. When I installed mysql- client & server I gave the program a password. Now I can not log in using that password or change the password.
# mysqladmin -u root password password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
However after messing around, removing, purging, reinstalling, etc. the suggested command still wouldn't connect. What I found that worked was:
$ mysql -p -u root
I gave it the password I'd set up initially and was able to configure mysql with amarok as suggested. You guys that are having problems might give that a try.
This was very helpful. But now i have a new computer and want to transfer the mysql amarok database over to it (all my favorite tracks, times played, etc.) Does anyone now how to do that?
PS - I am putting all of the music files in the same directory locations (Basically copied all the shared music in a same named file hierarchy. I dont know if that helps at all.)
Great howto Mike!
Have it bookmarked now so i can get back to it every time i mess something up ;P
Thanks a bunch ;)
Johan
Thanks a lot, I couldn't setup Amarok and MySQL without this blog article.
However, the recent version of MySQL package asks you to root password during its installation, so that the command line to set it, "mysqladmin -u root password PASSWORD" isn't needed after you've installed MySQL package. :)
Great tips! Thanks a lot. Now amarok works as smooth as I expected.
As last comment states, it's true that with mysql-server-5.0 there is no need to set root password from terminal with the given command.
This kind of post are those that should be bookmarked ;)
I've changed from sqlite to mysql as suggested, re builit my collection and everything is there except the play count/rating/score information. Can I copy it from sqlite? If I change amarok settings back to use sqlite all the info is there but not with amarok set to mysql. Where is this data stored and how can mysql see it? Any ideas.
Oh dear, you're right, no ratings! :(
HELP!!!
PS - see this one through, as even though I'm not sure I got 100% of my stats, I got the majority. Sorry for the blow by blow, but try this one:
http://amarok.kde.org/wiki/MySQL_HowTo:
In particular
[QUOTE]An alternate method is to import my SQLite data as follows:
* Start Amarok, change to MySQL, and build the database (but don't play any songs)
* Download SQLite Database Browser
* Export the statistics database to a dump file, amarok_dump.sql
* Remove all BEGIN TRANSACTION, COMMIT and CREATE sql commands
* Import the file using MySQL:
[/QUOTE]
Let me know if this works as it's somewhat obtuse directions.
Beautiful and awesome, it's really faster.
Thank you Mike
Heh, it seems that many trolls we have here and postrgre fanboys. How can you measure performance of MySQL and PostgreSQL in Amarok? You just sound like idiots to me :D In benchmarks MySQL eats Postgre at breakfast, so have a nice trolling...
Thanks for the tutorial. Works great!
By the way, it may be worth noting on my fresh install of Intrepid the root password is the same as my sudo password so the first step was not needed. That said I only have one user on my system.
Worked well in opensuse 11.0. Install "mysql" and "mysql-client" from zypper or yast. If you lost/forget password, try Recover your MySQL Password. Get familiar with "pgrep" and "pkill" because I was NOT using Debian (as that webpage was).
Good Luck.
Felipe
Works well. The new version of mysql logs you in, so this line:
mysqladmin -u root password PASSWORD
isn't necessary and won't work.
lol, I tought I had failed. But I had to rescan the library :D
thank you. it used to kill me, was so slow. it works perfect now.
Thank you for this post! How useful!
I can confirm this... it's mysql solved my problem.
However, isn't this too much for amarok? mysql 5? :(
all i want is music player and not music machine... :(
does this work for a dj panel, shoutout - requests etc. please get back to me.
yeah I think it would work fine for a DJ setup
Thanks for the instructions. We all need some help now and again.
Thanks, so simple yet so needed.
Worked flawlessly. Thanks!
Thank you.
Thx a million
I needed to reinstall MySQl database as I went from Amarok 2 back to Amarok 14
Hint I needed to add sudo to the MYSQL commands otherwise I reveice a weird error
sudo MYSQL -p root
I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
Betty
http://electricguitarhowtoplay.net
Post a Comment