i've tried at least half a dozen different methods from all over the web, but all of them fail. the usual procedure is some variation of this:
1. kill all mysql stuff
2. mysqld_safe --skip-grant-tables &
4. update user set password = password('password') where user = 'root' and host='localhost';
whereupon i get a:
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
looks good, so:
5. flush privileges;
7. ./mysql stop
8. ./mysql start
9. root@host:/etc/init.d # mysql -u root -p mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
sometimes i exit and then flush privileges with mysqladmin, sometimes i don't flush privileges, but nothing works. sometimes with one of the password syntaxes i found at one of the sites somewhere i get a "you launched mysql as --skip-grant-tables so you can do that."
something happened in phpmyadmin, i think, but i'm new to both of those programs so i'm not sure what i might have done. but now i can't log into either.
i finally had to apt-get --purge all the mysql stuff and reinstall. before that i tried moving the mysql tables and regenerating the install_db, but then i started getting all kinds of errors about the debian-sys-maint account not having the right permissions or something. now everything seems to be working.