Difference between revisions of "Resetting MySQL root password"
From Notes_Wiki
(Created page with "=Resetting mysql root password= In case we have root privileges on server and want to reset mysql root password then we can use following steps: #Stop mysql service if it is...") |
m |
||
Line 10: | Line 10: | ||
#Stop mysql using command "service mysqld stop" | #Stop mysql using command "service mysqld stop" | ||
#Start mysql again without any password or with the new password set. | #Start mysql again without any password or with the new password set. | ||
Back to [[Mysql configuration]] |
Revision as of 23:08, 17 November 2012
Resetting mysql root password
In case we have root privileges on server and want to reset mysql root password then we can use following steps:
- Stop mysql service if it is running.
- Use command 'mysqld_safe --skip-grant-tables' to run mysql without any priviledge information
- Connect to mysql by simply typing 'mysql' without any options
- Use database mysql using 'use mysql'
- Change root password or disable it using "update user set password=password('secret') where user='root'" or "update user set password= where user='root'"
- Stop mysql using command "service mysqld stop"
- Start mysql again without any password or with the new password set.
Back to Mysql configuration