Falconx
Falconx

Reputation: 279

Error 1045 MySQL during setup

Could anyone explain to me error 1045 during MySQL setup. I'm getting this error after reinstalling. I 'm trying to install on windows 7. On the last stage of installation (i.e apply security settings) I'm getting the following message:

The security settings could not be applied. Error Number 1045.
Access denied for user 'root' @ 'loaclhost'(usinf password: NO).

How can I get around this?

Upvotes: 16

Views: 88748

Answers (10)

Joseph
Joseph

Reputation: 1536

disabling windows firewall before installation did the trick for me!

Upvotes: 0

FSaeed
FSaeed

Reputation: 23

  1. Stop MySQL services from the Control Panel>> Administrative Services>> Services
  2. Uninstall from the Control panel
  3. Delete folder from Program files, Program Data and Program Files(x86)
  4. Remove the path from the Environment Variable ( Very important)
  5. Must uninstall MySQL Server, MySQL Workbench and installer

if leave the connectors to uninstall, it would not make any difference. Restart depend how efficient your machine is and then install again, it will be configured and will be running again without any error.

Upvotes: 0

imdzeeshan
imdzeeshan

Reputation: 1118

While re-Installing MySQL. Under Modify Security Settings option, check "current root password" field. If MySQL was not installed earlier and this current root password field is visible, keep this empty. Fill in your new root password in next two fields. hope this solves your problem.

enter image description here

Upvotes: 5

manishbka
manishbka

Reputation: 1

To resolve this error

The security settings could not be applied. Error Number 1045. Access denied for user 'root' @ 'loaclhost'(usinf password: NO).

Please follow these steps:

  1. Uninstall the MySl server instance from the control panel
  2. Stop the service if it is re-running
  3. Remove all folders related to MySl from Program Files
  4. Remove the ProgramData folder from MySl Install Drive. This is a hidden folder - you'll have to make them visible. Also delete all folders related to MySl
  5. Download the MySl installer and check for your system type - the 32 bit installer should be mysql-essential-5.1win32 and the 64 bit should be mysql-5.1.73-winx64
  6. Follow the installation instructions and choose the detailed configuration

If you follow these steps properly you should be able to resolve the issue

Upvotes: -1

Sebastien Chartier
Sebastien Chartier

Reputation: 130

This solution worked for me (http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html) :

C.5.4.1.1. Resetting the Root Password: Windows Systems

On Windows, use the following procedure to reset the password for all MySQL root accounts:

Log on to your system as Administrator.

Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. Find the MySQL service in the list and stop it.

If your server is not running as a service, you may need to use the Task Manager to force it to stop.

Create a text file containing the following statements. Replace the password with the password that you want to use.

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

Write the UPDATE and FLUSH statements each on a single line. The UPDATE statement resets the password for all root accounts, and the FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.

Save the file. For this example, the file will be named C:\mysql-init.txt.

Open a console window to get to the command prompt: From the Start menu, select Run, then enter cmd as the command to be run.

Start the MySQL server with the special --init-file option (notice that the backslash in the option value is doubled):

C:\> C:\mysql\bin\mysqld --init-file=C:\\mysql-init.txt

If you installed MySQL to a location other than C:\mysql, adjust the command accordingly.

The server executes the contents of the file named by the --init-file option at startup, changing each root account password.

You can also add the --console option to the command if you want server output to appear in the console window rather than in a log file.

If you installed MySQL using the MySQL Installation Wizard, you may need to specify a --defaults-file option:

C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe"
         --defaults-file="C:\\Program Files\\MySQL\\MySQL Server 5.5\\my.ini"
         --init-file=C:\\mysql-init.txt

The appropriate --defaults-file setting can be found using the Services Manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. Find the MySQL service in the list, right-click it, and choose the Properties option. The Path to executable field contains the --defaults-file setting.

After the server has started successfully, delete C:\mysql-init.txt.

You should now be able to connect to the MySQL server as root using the new password. Stop the MySQL server, then restart it in normal mode again. If you run the server as a service, start it from the Windows Services window. If you start the server manually, use whatever command you normally use.

Upvotes: 2

user2859529
user2859529

Reputation: 11

1) remove instance using MySQL Server Instance Config Wizard

2) uninstall MySQL

3) go to C:\Program Files (x86) or C:\Program Files and delete MySQL folder

4) then go to C:\ProgramData (sometimes it's a hidden folder), find and delete MySQL folder

5) restart pc

6) reinstall MySQL

Upvotes: 1

Torben
Torben

Reputation: 3912

What worked for me on a 64 bit Windows 7 was

  1. Uninstall
  2. Remove C:\Program Files\MySQL
  3. Remove C:\ProgramData\MySQL (This folder may be hidden)
  4. Reinstall

Upvotes: 35

Keramat
Keramat

Reputation: 41

This is a solution, Error 1045 MySql Instalation.

  1. Stop MySql from running{control panel | Administrative Tools | Services}

  2. Make sure to uninstall the previous MySql from control panel

  3. remove all mysql directories and names from window explorer even those are hidden, In th case that there are some applications which are using mysql and are always on run and you can not remove the mysql dependencies from, you rename them. For example you have Ruby1.9, go head just rename it to RubyBack1.9 and rename them back once you finish with mysql installation. Or other alternative is you kill the process once you reach to step 9

  4. go to firewall from control panel, click on advanced setting in the left panel. Now, click on inbound rules. Add two mysql's under name one with Domain Profile the other with Private Profile.

  5. click on the one with Domain Profile you just have added.

  6. click on the Properties down in the right panel

  7. under scope tab on the top, click on the radio button and type 127.0.0.1

  8. under Protocol and Ports tab pick for protocol tcp and type for port 3306. Make sure to click OK to save the changes.

  9. restart your computer

  10. Now, go to the task manager and kill any mysql or its product jobs if any is running.

  11. Finally, re-install mysql-5.5.28-win32.msi or mysql-5.5.28-win64.msi accordingly.

Good Luck

Upvotes: 4

Mohd Kose Avase
Mohd Kose Avase

Reputation: 1

  • Uninstall mySQL.
  • Go to C:\Program Files
  • Delete the MySQL folder.
  • Reinstall mySQL.

It will work.

Upvotes: -1

Jim Garrison
Jim Garrison

Reputation: 86774

Based on the minimal information you've provided, it sounds like you're using a database from the previous install that already has a root password defined.

Reinstall MySQL after first completely deleting all directories into which you previously installed MySQL.

EDIT:

Also take a look at 2.10.2.1.5. Changes Made by MySQL Installation Wizard in the MySQL online manual. You may have to delete some registry keys.

Upvotes: 0

Related Questions