- Stop mysqld and restart it with the
--skip-grant-tables option.
-
to start use # /usr/bin/mysqld_safe --skip-grant-tables
- Connect to the mysqld server with this command:(you may have to use new shell / window for this)
shell> mysql
- Issue the following statements in the mysql client. Replace the password with the password that you want to use.
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
-> WHERE User='root';
mysql> FLUSH PRIVILEGES;
- stop mysqld server using service mysqld stop - make sure to stop and restart so that new service will be password protected
- restart server with service mysqld start
This entry was posted
on Wednesday, March 18th, 2009 at 1:47 am and is filed under MySQL.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.