It is quite frequent that an administrator simply forgets his mysql’s root password.
Luckily, it is quiet easy to reset it, here are the steps:
- SSH as root to your machine
- Turn off the mysqld daemon if running
- RedHat/Fedora users can do so by executing:Â service mysqld stop
- safe_mysqld –skip-grant-tables
(this will run allow you to connect without a password)
- mysql mysql
(to directly connect and select the mysql database which contains the user authentication data)
- update user set password=password(‘newpassword’) where user=’root’;
where newpassword is your newly chosen password.
- service mysqld start