You are not logged in.

#1 2009-10-03 04:08:48

spektr
Member
Registered: 2009-10-03
Posts: 6

Amarok 2.2 - MySQL Error

Hi all,

I've got another problem with the new Amarok (I'm running kdemod-extragear-amarok 2.2.0-3, but the the problem also occurs with the amarok 2.2 from [extra] and amarok-git): The collection doesn't work because of some sort of MySQL problem. Whenever I try to scan my collection, I get the following errors showing up:

amarok:          [ERROR!] Tried to perform query on uninitialized MySQL

I am running the newest kdemod (4.3), and have the following MySQL packages installed:

pacman -Qs mysql
local/libmysqlclient 5.1.37-1
    MySQL client libraries
local/mysql 5.1.37-1
    A fast SQL database server
local/mysql-clients 5.1.37-1
    MySQL client tools

From what I've been able to find, this is likely an error with how MySQL was compiled? Ideas?

Last edited by spektr (2009-10-03 04:09:23)

Offline

#2 2009-10-03 06:05:32

drelyn86
Member
From: Indianapolis, IN
Registered: 2009-04-10
Posts: 80

Re: Amarok 2.2 - MySQL Error

Have you started the mysql daemon?

Edit: You also have to set up a database and user in mysql.

Taken from the Amarok wiki...

If your locale is UTF-8, make sure the default character set for your mqsl daemon is set up to utf8, so that all databases and tables are created with character set utf8. In Debian:

1) Edit /etc/mysql/my.cnf, adding this line to stanzas [client] and [mysqld]:

default-character-set = utf8

2) Restart the mqsql daemon to pick up the new default charset

Do this before you create the database for amarok.

Make sure the MySQL daemon is running. If necessary, add it to your linux startup scripts, via whatever method your distro uses.

Create a root password for MySQL, if you have not already done so.

$ mysql -u root 
set password for root@localhost = password('xxxxxxx'); 
flush privileges; 
quit;

Of course change xxxxxx to the password you want.

Once you have done that, you must create a MySQL database and a user for amarok for through any usual method. You can just use the "mysql" command: (it will ask for your MySQL root password)

$ mysql -p -u root
CREATE DATABASE amarok;
USE amarok;
GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'PASSWORD_CHANGE_ME';

In the above example, a database called "amarok" and a user called "amarok" were created. This user can access the database from localhost using the password "PASSWORD_CHANGE_ME". To allow access from remote hosts, use amarokuser@'%'.

It is very important that you 'GRANT ALL' privileges to user "amarok". In particular, "amarok" needs ALTER privileges on its database.

Once a database exists, open the Configure Amarok screen (found in the Settings menu), and go to the Collection tab. Change the drop-down menu from SQLite to MySQL. You will have to specify the host ("localhost" if the database is in your local box), port (3306 is the common value), and the name of the database that you have created for it ("amarok" in our example). Additionally, the username and password of a user who has write access to the given database needs to be specified (in our example, the user is "amarok", and the password is "PASSWORD_CHANGE_ME").

Remote MySQL Server Gotcha: Most MySQL installs have the daemon listening only to localhost by default.

So if you get errors about not being able to connect to the server or database, (_not_ password related errors) then you will have to edit my.cnf on the host machine (/etc/mysql/my.cnf, most likely), comment out the "bind_address" variable and restart MySQL. You may have to comment out "skip_networking", so that MySQL will listen on a tcp socket.

AFIAK there is no way of tweaking which interfaces it listens on. It listens on only 1 or on all. You should then update your firewall accordingly.

Last edited by drelyn86 (2009-10-03 06:08:52)

Offline

#3 2009-10-03 10:37:09

spektr
Member
Registered: 2009-10-03
Posts: 6

Re: Amarok 2.2 - MySQL Error

Hey,

Thanks for all of that - but I'm not looking to use an external mysql server (which is what your instructions below apply to), I merely want to use mysqle, which is built-in to Amarok 2.x.


drelyn86 wrote:

Have you started the mysql daemon?

Edit: You also have to set up a database and user in mysql.

Taken from the Amarok wiki...

If your locale is UTF-8, make sure the default character set for your mqsl daemon is set up to utf8, so that all databases and tables are created with character set utf8. In Debian:

1) Edit /etc/mysql/my.cnf, adding this line to stanzas [client] and [mysqld]:

default-character-set = utf8

2) Restart the mqsql daemon to pick up the new default charset

Do this before you create the database for amarok.

Make sure the MySQL daemon is running. If necessary, add it to your linux startup scripts, via whatever method your distro uses.

Create a root password for MySQL, if you have not already done so.

$ mysql -u root 
set password for root@localhost = password('xxxxxxx'); 
flush privileges; 
quit;

Of course change xxxxxx to the password you want.

Once you have done that, you must create a MySQL database and a user for amarok for through any usual method. You can just use the "mysql" command: (it will ask for your MySQL root password)

$ mysql -p -u root
CREATE DATABASE amarok;
USE amarok;
GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'PASSWORD_CHANGE_ME';

In the above example, a database called "amarok" and a user called "amarok" were created. This user can access the database from localhost using the password "PASSWORD_CHANGE_ME". To allow access from remote hosts, use amarokuser@'%'.

It is very important that you 'GRANT ALL' privileges to user "amarok". In particular, "amarok" needs ALTER privileges on its database.

Once a database exists, open the Configure Amarok screen (found in the Settings menu), and go to the Collection tab. Change the drop-down menu from SQLite to MySQL. You will have to specify the host ("localhost" if the database is in your local box), port (3306 is the common value), and the name of the database that you have created for it ("amarok" in our example). Additionally, the username and password of a user who has write access to the given database needs to be specified (in our example, the user is "amarok", and the password is "PASSWORD_CHANGE_ME").

Remote MySQL Server Gotcha: Most MySQL installs have the daemon listening only to localhost by default.

So if you get errors about not being able to connect to the server or database, (_not_ password related errors) then you will have to edit my.cnf on the host machine (/etc/mysql/my.cnf, most likely), comment out the "bind_address" variable and restart MySQL. You may have to comment out "skip_networking", so that MySQL will listen on a tcp socket.

AFIAK there is no way of tweaking which interfaces it listens on. It listens on only 1 or on all. You should then update your firewall accordingly.

Offline

#4 2009-10-09 11:29:49

spektr
Member
Registered: 2009-10-03
Posts: 6

Re: Amarok 2.2 - MySQL Error

I find it hard to believe that *no one* has had this problem with Amarok 2.2? It seems that it's a packaging error with QT or MySQL that's causing the problem, so everyone should be seeing this! Devs?

Edit: Seems like my local mirror is terribly out of date - running a full sysupgrade and will check back to see if it solves the problem smile

Last edited by spektr (2009-10-09 11:44:35)

Offline

Board footer

Powered by FluxBB