> -----Original Message-----
> Karia Amit
> 
> Subject: [ILUG-BOM] Mysql Help
> 
> I Have lost root password for mysql , I have got mysql daemon started in
> my machine , I have tried to login to mysql using the following command
> mysqladmin -u root -p <password> it just doesnt Allow me to login, Please
> let me know how do i change the root password for mysql
> 
> regards
> Amit


1. Shutdown mysql daemon (/etc/rc.d/init.d/mysqld stop)

2. Verify there are no active processes still present (ps auxw|grep mysql)

3. Restart mysql daemon skipping the access table rights
(/path_to/mysql/bin/safe_mysqld --skip-grant-tables)

4. Connect to mysql db using the mysql client (/usr/path_to/mysql/bin/mysql
mysql)

5. Run the query (UPDATE user SET Password=PASSWORD('new_password') 
WHERE Host='localhost' AND User='root';)

Repeat the above step for any other users you would like to modify.

Then run FLUSH PRIVILIGES;

6. exit and then kill the exisiting daemon.

7. Restart the mysql process using the startup script
(/etc/rc.d/init.d/mysqld start)

Hope this helps.

Take care,
Paul Alapatt

http://www.bernardlabs.org/




-- 
http://mm.ilug-bom.org.in/mailman/listinfo/linuxers

Reply via email to