Problem solved!
I was having all my website set up first in XAMMP, then I had to transfer it to LAMP, in a SUSE installation of LAMP, where I got this error.
The problem is that these parameters in the database.php file should not be initialised. Just leave username and password blank. That's just it.
(My first and lame guess would be that's because of old version of mysql, as built-in installations come with older versions.