I finally got a Raspberry Pi for Christmas and decided to set it up as a home web server. I have nginx with php setup and working. I came to install mysql and ran sudo apt-get install mysql-server. When setting the password I used a 32 character generated password with letters, numbers and symbols, however I don't believe it copied into the terminal correctly as I could not login with this password after the install.
After trying to reset the password (mysqld_safe --skip-grant-tables seemed to prevent me from connecting to mysql altogether (no sockets or network access was available after I started mysql with this flag). I decided a better approach would be to just completely re-install mysql as I had not setup any databases yet anyway. After doing plenty of apt-get purge mysql-server and trying to remove various folders I found that, apt-get purge mysql-server followed by a apt-get autoremove and then a restart seemed to correctly remove mysql (or so I thought) as the next install asked for a new root password.
As this install finished it failed to set the mysql unix user password (I had forgotten to remove it). This meant that mysql couldn't start and the installation is now sat in a partial state. Whenever I used apt-get to purge or autoremove it again attempts to complete the install. I've tried updating the mysql user to the new password I set however this has not allowed the install to complete.
How can I get apt-get to just rollback the install so I can start again rather than continuing to keep trying to complete a broken install?