Reset MySql Superuser-Administrator-Root Password

Since i dislike to save important passwords on computers - nor in plaintext neither encrypted - i 'd several time to reset MySql's superuser password.

Here is how it works on my Linux boxes

Stop the My-SQL daemon

/etc/init.d/mysql stop

Start MySql daemon w/o access control and network support to prevent remote access while reseting

mysqld_safe --skip-grant-tables --skip-networking &

Reset the password

mysqladmin -u root flush-privileges password "newpassword"

and restart the My-SQL daemon

/etc/init.d/mysql restart

thats's all.

No comments: