Here's what i did to reset the root passwords on my database (this is my development box, since I re-install Mysql quite frequently, I'm sometime lazy and use the root account for development)
Stop the Mysql server
In Lucid some init.d scripts (maybe all - not sure) have been converted to services. To stop Mysql type:laptop$ sudo stop mysql
Restart MySQL, wo network communication and authentication
laptop$ sudo mysqld --skip-grant-tables --skip-networking &
Reset the password
laptop$ mysql mysql -u root mysql> UPDATE user SET password=PASSWORD('supersecretpassword') WHERE user="root"; mysql> FLUSH PRIVILEDGE;
Kill and Restart Mysql Service
laptop$ sudo kill `ps -C mysqld -o pid=` [1]+ Done sudo mysqld --skip-grant-tables --skip-networking laptop$ sudo start mysql mysql start/running, process 11822
Test the connection
mysql -uroot -p
You should be now connected !
Note:
Btw, if you wonder how to find out what Ubuntu release you're running try:yacin@ybsis_laptop_1: cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=10.04 DISTRIB_CODENAME=lucid DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS"