Global Linux Knowledge Base…
Reset Forgotten MySQL Root Password
| For mysql, the system administrator user is called root. We will use the mysqladmin utility from a command line to set the new password. Default password is not secured at all. By default in RedHat, Fedora and Centos default password is null. So it is always better to set root password. |
| To re-set root password, first stop mysql service. |
| # service mysqld stop |
| # mysqld_safe –skip-grant-tables |
| Where, |
|
mysqld_safe = MySQL server startup script
|
| –skip-grant-tables = This enables anyone to connect without a password and with all privileges. |
|
# mysql -u=root mysql;
|
|
mysql > update user set Password=PASSWORD(‘new-password’) where user=’root’;
|
| mysql > flush privileges; |
| mysql > exit; |
| Print article | This entry was posted by Dhaval Soni on December 29, 2010 at 11:17 PM, and is filed under All, CentOS, Database, Fedora, Linux OS, MySQL, Red Hat. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |