Bug 272346

Summary: Amarok doesn't pass password to external mysql db if it is set as 'password'
Product: [Applications] amarok Reporter: N.M <IcarianHeights>
Component: Collections/LocalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: dufton, mitchell, ralf-engels
Priority: NOR    
Version: 2.4-GIT   
Target Milestone: 2.4.1   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 2.6

Description N.M 2011-05-03 18:02:35 UTC
Version:           2.4-GIT (using KDE 4.6.2) 
OS:                Linux

I setup external mysql db named 'amarokdb' and created user 'amarokuser' with password 'password' and granted all privileges to this 'amarokuser' to the 'amarokdb'...

however, when i tried to start amarok (after changing options to select external db from amarok's settings) i continued to get an error indicating amarok could not connect to the external db..

When starting Amarok a popup gui box would indicate the following error:

"GREPME MySQL-server query failed! (1045) Access denied for user 'amarokuser'@'localhost' (using password: NO) on na"

and starting amarok from commandline with --nofork and --debug options would give me a simillar
"tried to query and uninitialized m_db!" 

The funny thing, was if i changed the user to root and the root password for the mysql host in the amarok's db settings i could connect fine... I also could connect just fine to the db using the 'amarokuser' account via the commandline...

so after going to #amarok, i tried changing the 'amarokuser' password from 'password' to 'newpassword' and lo and behold amarok was able to successfully connect when started up to the db and was able to perform a full collection scan...

it seems as if, if the password field is left as 'password' amarok assumes no password is being passed to the database (hence the pop up error stating that no password is being used)... not sure if this is the intended functionality, but i would assume not, as otherwise there should be a warning/message that using default password is not accepted...

just to test out the theory i created another user 'anotheruser' with the password 'password' and got the exact same error message... so it seems as amarok will not accept or pass the password to the mysql server if the password is 'password'...

here are the two relevant pacakges i have installed:
~ >>> pacman -Qi amarok-git
Name           : amarok-git
Version        : 20110501-1
Architecture   : x86_64
Build Date     : Sun 01 May 2011 11:26:54 PM EDT
Install Date   : Sun 01 May 2011 11:28:11 PM EDT


~ >>> pacman -Qi mysql
Name           : mysql
Version        : 5.5.11-1
Architecture   : x86_64
Build Date     : Tue 05 Apr 2011 05:26:11 AM EDT
Install Date   : Sun 24 Apr 2011 02:31:31 AM EDT


Reproducible: Always

Steps to Reproduce:
create any user and grant access to amarokdb....

give said user password of 'password'

configure settings correctly in amarok external db settings window...

try to open/start amarok so as to begin collection (re)scan

amarok will be unable to connect if password for the configured user is 'password'

Actual Results:  
amarok will be unable to connect if password for the configured user is 'password'

starting amarok from gui will result in pop error dialog stating "GREPME MySQL-server query failed! (1045) Access denied for user 'amarokuser'@'localhost' (using password: NO) on na"

and starting amarok from commandline with --nofork and --debug options would give me a simillar
"tried to query and uninitialized m_db!" 

Expected Results:  
amarok should have passed the password 'password' to the mysql server so amarok can access/create/modify tables as needed... or at least warn the user that the default password of 'password' is unable to, or shouldn't be used...

OS: Linux (x86_64) release 2.6.38-ARCH
Compiler: gcc

here are the two relevant pacakges i have installed:
~ >>> pacman -Qi amarok-git
Name           : amarok-git
Version        : 20110501-1
Architecture   : x86_64
Build Date     : Sun 01 May 2011 11:26:54 PM EDT
Install Date   : Sun 01 May 2011 11:28:11 PM EDT


~ >>> pacman -Qi mysql
Name           : mysql
Version        : 5.5.11-1
Architecture   : x86_64
Build Date     : Tue 05 Apr 2011 05:26:11 AM EDT
Install Date   : Sun 24 Apr 2011 02:31:31 AM EDT
Comment 1 Lachlan 2012-04-26 23:02:30 UTC
Bug is still present in latest version.  Fix posted at https://git.reviewboard.kde.org/r/104751/
Comment 2 Matěj Laitl 2012-04-29 09:10:43 UTC
Git commit b7fb7034757e185ceb0a17180314dd7b63fb4169 by Matěj Laitl, on behalf of Lachlan Dufton.
Committed on 29/04/2012 at 11:05.
Pushed by laitl into branch 'master'.

Fix bug 272346, unable to set MySQL password to 'password'

Praise Lachlan for spotting inconsistency between default value in .xml
file and in code.
FIXED-IN: 2.6
REVIEW: 104751

M  +2    -0    ChangeLog
M  +2    -1    src/core-impl/collections/db/sql/mysqlservercollection/MySqlServerCollection.cpp

http://commits.kde.org/amarok/b7fb7034757e185ceb0a17180314dd7b63fb4169