In order to reset your root password for mysql:
- Find mysqld_safe application (usually in /usr/bin/mysqld_safe)
- Stop currently running mysqld process:
/etc/init.d/mysqld stop - Start mysql in a safe mode with --skip-grant-tables option using previously found path of mysqld_safe. This gives full access for all users with no passwords:
/usr/bin/mysqld_safe --skip-grant-tables & - Enter mysql:
mysql - Type:
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
Mind that UPDATE and FLUSH should be in different lines. - Restart mysql with usual settings:
/etc/init.d/mysqld restart