MySQL on Windows Access denied for user ‘root’@'localhost’ (using password: NO)

I use MySQL 5.1 ‘on localhost’ commonly for wordpress development. Today started new project and attempted to design database using MySQL Control Center, Navicat, command line mysql client and all time get this fucking annoying

Access denied for user ‘root’@'localhost’ (using password: NO)

Who is fault? No matter. Probably, because of my root user doesn’t have password.

What to do? Finally i did next:

1. Stopped mysql server: i simply found mysqld process in windows task manager and stopped it.
2. Created init.txt file with next content:

UPDATE mysql.user SET Password=PASSWORD(‘mypassword’) WHERE User=’root’;
FLUSH PRIVILEGES;
grant all privileges on *.* to root@localhost identified by ‘mypassword’ with grant option;
grant all privileges on mydatabase.* to root@localhost identified by ‘mypassword’ with grant option;

3. Run mysql server from command line as:

mysqld –init-file=F:\mysql\bin\init.txt

voila

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • RSS
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • BlinkList
  • blogmarks
  • DZone
  • E-mail this story to a friend!
  • LinkaGoGo
  • Live
  • MisterWong
  • MisterWong.DE
  • Reddit
  • StumbleUpon
  • Technorati
  • ThisNext
  • Tumblr

Related posts:

  1. How to copy content from one database to another

Leave a Reply


Wordpress Seo Plugin