Please help me how to install MySQL on Windows 7. When I tried to install, I am getting errors as:

The security settings could not be applied to the database because the connection has failed of the following errors

ERROR NR:1045 Access denied for user 'root@'localhost(using password yes).

I tried to uninstall MySQL completely and install again, but it shows this error again and again. I have changed my firewall setting also and tried unstalling antivirus sotware too. But it also did not work.

migrated from Jun 20 '11 at 8:14

This question came from our site for professional and enthusiast programmers.

  • what is your root password? does it even have a password? – Yasser Souri Jun 20 '11 at 5:37
  • Think he has just installed and doesnt know where to change – Balanivash Jun 20 '11 at 5:38
  • its pwd error..not Windows 7 security error.. – thecodejack Aug 7 '12 at 7:06

I had this problem, and explicitly running the MySQL installer as Administrator (right-click, select 'Run as Administrator') fixed it for me.

Was the provided password correct?

Otherwise please check here:,39440,417422#msg-417422

# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> quit

# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <newpassword>
  • 1
    Your answer is for a linux system and in the question it has been specifically stated that the problem is in wondows – Balanivash Jun 20 '11 at 5:59

Where you installed the mysql, there should be a file called my.cnf or my.ini, in there should be the root password .e.g

C:\Program Files\MySQL\MySQL Server 4.1\my.ini

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.