Set / Change / Reset the MySQL root password on Ubuntu Linux (Ubuntu)

Posted by & filed under Code.

This came in veeeerrryyy handy just now… Stop the MySQL Server sudo /etc/init.d/mysql stop   Start the mysqld config sudo mysqld –skip-grant-tables & Login to the server as root mysql -u root mysql Ser your NEWPASSWORD UPDATE user SET Password=PASSWORD(‘NEWPASSWORD’) WHERE User=’root’; FLUSH PRIVILEGES; exit;