Welcome to my site. Please CLICK HERE to give your opinions regarding this new look of "PCTipsbyAnu". Thanks for visiting.

Tuesday, February 22, 2011

Browse » Home » , , » How do reset MySQL root password?

How do reset MySQL root password?

Here is the very simple and effective way to hack/reset MySQL root password....
The Mysql root password can be set using the following procedure:

1. Stop the MySQL service:
# service mysqld stop

Example output:
#service mysqld stop
Stopping MySQL: [OK]

2. Start MySQLwith:
# /usr/bin/safe_mysqld --skip-grant-tables &

On Red Hat Enterprise Linux 5, safe_mysqld has been changed to mysqld_safe.

Note: safe_mysqld is a shell script which invokes mysqld, but additionally traps any forceful terminations of the MySQL server and avoids any database corruption.

3. Change the password of the root user:
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('new_password') WHERE user='root'
mysql> exit;

4. You could perform Step 1 here and avoid using Step 4, but in some cases, the startup script may not behave as expected since mysqld was started directly, i.e. not using the init script.
# mysqladmin shutdown

5. Start the MySQL service:
# service mysqld start

Example output:
# service mysqld start
Starting MySQL: [ OK ]
You can leave a response, or trackback from your own site.

About 'Anu': My name is 'Anu' also Known as 'ANU 007 TIGER' .I'm administrator of 'PC Tips by Anu' blog .This blog was opened for sharing contents about hacking n cracking.


Post a Comment

Back to Top