Difference between revisions of "Reset MySQL root password"
From Organic Design wiki
(better process) |
m |
||
Line 5: | Line 5: | ||
To reset the root password of a MySQL server, first go to a root shell and stop MySQL: | To reset the root password of a MySQL server, first go to a root shell and stop MySQL: | ||
{{code|<pre> | {{code|<pre> | ||
− | + | service mysql stop | |
</pre>}} | </pre>}} | ||
Line 18: | Line 18: | ||
{{code|<pre> | {{code|<pre> | ||
mysql -u root | mysql -u root | ||
− | use mysql | + | use mysql |
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; | update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root'; | ||
flush privileges; | flush privileges; | ||
Line 27: | Line 27: | ||
And restart the MySQL server again: | And restart the MySQL server again: | ||
{{code|<pre> | {{code|<pre> | ||
− | + | service mysql start | |
</pre>}} | </pre>}} |