Some of us come ac crossed this error when we try connecting Mysql using no password. ie., when we connect the mysql by the command "mysql -u root" . When we installing mysql in windows it will ask root password for creating my.ini file. After configuring root password when ever you connect the mysql you should use the command "mysql -u root -p" and enter the password when prompted.
This will create head aches when you connect mysql through java driver using connection string with out password in a development environment. To over come this, just reset the password to empty string by using the following three steps/commands -
- UPDATE mysql.user SET Password=PASSWORD('') WHERE User='root';
- grant all privileges on *.* to root;
- FLUSH PRIVILEGES;