Trouble with installation on Ubuntu precise 12.04

I setup /etc/my.cnf file. I add the precise percona repos, and do the installation through the command:

apt-get install percona-server-server-5.5

As it is installing, it prompts me to set “root” password. I do that and confirm. It then tells me it can’t set the root password, it failed. Eventually, I get mysql started, but I can’t login. I try with no password, and I try with the one I attempted. Either way I fail.

root# mysql -p

Am I missing something very obvious? I’ve tried apt-get remove, and install again. Nothing seems to work.

Specific error messages:

120701 5:01:54 [Warning] Access denied for user ‘root’@‘localhost’ (using password: YES)120701 5:01:58 [Warning] Access denied for user ‘root’@‘localhost’ (using password: NO) .html

Maybe you had an old mysql installation in your datadir. If this is the case, you have to use the password that you had in your old mysql installation.