|
[Linux] Reset MySQL Password
*** It is very important that you restart MySQL (Step #5). If you do not, anyone can connect to MySQL and do anything they want ***
1. Login to your server and "su -" to root (do not forget the - after su).
2. Stop MySQL:
# /etc/init.d/mysql(d) stop
3. Start MySQL without authentication:
# /usr/bin/safe_mysqld --skip-grant-tables &
4. Connect to MySQL and update password:
[code:1:e3c8075c1d]
# mysql -u root
mysql> use mysql
mysql> update user set Password=password('newpassword') where User='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 | Changed: 2 | Warnings: 0
mysql> quit
[/code:1:e3c8075c1d]
5. Restart MySQL:
# /etc/init.d/mysql(d) restart
*** Again, it is very important that you restart MySQL. If you do not, anyone can connect to MySQL and do anything they want ***
__________________
Just a jeans & flip-flop's kind of girl.
|