How to Reset user root on Mysql
Have u ever forget ur root password on ur server ..
Well i have often forget about it..
So i write it here to help me when i forget my password again
first of all .. u should connect to ur server using ssh or telnet
and log in to ur root account
- After u log in as root u should stop mysql server before we can proceed type this line
- and then u should restart mysql with disabling network comunication and skipping the authentication procedure
” /usr/bin/mysqld_safe –skip-grant-tables “
- And try to open new session or duplicate session and try to connect to mysql and type this line
u will see
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 5.0.22
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> UPDATE user SET Password=PASSWORD(‘password’)
-> WHERE Host=’localhost’ AND User=’root’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
- Don’t forget to flush all the privilages using
- Restart mysql using ” /etc/init.d/mysqld restart”
there u go ..
hope it can help me again sometimes