By default, MySQL server will be installed with root account and password is blank. If you have set the password for root and forget it, then you will need to reset the root password for MySQL.
This topic has detail steps on how to reset password for root on MySQL Server.
Step 1: Stop MySQL service
service mysqld stop
Step 2: Start MySQL with mysql-safe command
mysql-safe --skip-grant-tables &
–skip-grant-tables is a option to enable anyone connect MySQL Server without password and with all privileges.
Step 3: Connect MySQL with root account and blank password
mysql -u root -p
Step 4: Change password for root account
mysql> UPDATE mysql.user SET password = PASSWORD('NEW_PASSWORD') WHERE User = 'root'; mysql> FLUSH PRIVILEGES; mysql> exit;
Step 5: Restart MySQL
service mysqld restart
Related Posts:
- How To Restore Default Permissions Of All Files Under / (ROOT)
- How Do I Fix “Host is blocked because of many connection error” In MySQL
- Auto Backup Server Files & MySQL To FTP Server
- How to backup and restore large mysql database
- Create A MySQL User Account
- How To Make Multiple Updates Using A Single Query In MySQL
{ 1 comment… read it below or add one }
it’s useful for me ! sometime it’s good for some other with absent-mind 😀