I love Free Software!

Pages

Funny Quotes to Think

When you say "I wrote a program that crashed Windows", people just stare at You blankly and say "Hey, I got those with the system, for free"

-Torvalds, Linus(1995-03-08)-

Friday, January 29, 2010

Reset MySql Password

Follow below steps for reseting mysql password in Debian linux
  • Login to server as root
  • kill mysql server pid. In debain you can find pid file in /var/run/mysqld
kill `cat /var/run/mysqld/mysqld.pid`
  • Create a text file and add below sql statements to text file. Change 'password' to new password required
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES; 
  • Start mysql server with --init-file option 
mysqld_safe --init-file=/path/to/textfile &

Now login to mysql using new password

No comments:

Post a Comment