Bug #18555 Security setting fail during instance creation
Submitted: 27 Mar 2006 21:50 Modified: 25 Mar 2011 22:08
Reporter: Syed Ahmed Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:5.0.19, 5.1, 5.5 OS:Windows (Window XP Pro SP2)
Assigned to: CPU Architecture:Any

[27 Mar 2006 21:50] Syed Ahmed
Description:
Problem while installing and creating server instance fro
MySQl version 5.0.19
Options for service instance creation
 1. Install as windows server (checked)
 2. Laucn the MySql Server Automaticall (checked)
 3. Include Bin Directory in Windows PATH (checked)
Next screen
 1. Modify setting (checked)
 2. Create An Anonymous Account (not checked)

Installation manual recommends in

2.3.4.12. The Security Options Dialog
It is strongly recommended that you set a root password for your MySQL server, and the MySQL Configuration Wizard requires by default that you do so. If you do not wish to set a root password, uncheck the box next to the Modify Security Settings option. 

To set the root password, enter the desired password into both the New root password and Confirm boxes. If you are reconfiguring an existing server, you need to enter the existing root password into the Current root password box. 

To prevent root logins from across the network, check the box next to the Root may only connect from localhost option. This increases the security of your root account. 

To create an anonymous user account, check the box next to the Create An Anonymous Account option. Creating an anonymous account can decrease server security and cause login and permission difficulties. For this reason, it is not recommended. 

 3. enter the password in pasword field
 4. enter password confirm field

 5. Enable root access from remote machine (not checked)
 6. Cleck on the next button
 7. click execute button.

 Results
 1. Prepare configuration (pass)
 2. Write configuratin file (pass)
 3. Start service (pass)
 4. Apply security setting failed with follwoing error

  Error Nr.  1045
  Access denied for user root@localhost (using password:NO)

  

How to repeat:
Just try creating a an instance

Suggested fix:
You guys should know better
[28 Mar 2006 16:03] Valeriy Kravchuk
Thank you for a problem report. What exact password for root you had provided? If none, please, set one while installing and try to start instance again.
[28 Mar 2006 16:31] Syed Ahmed
After the install while creating a server instance and configuration using Server Instance config Wizard and choosing the Standard Configuration option, in the screen where "Modify Security Settings" check box is checked by default, I entered the password abc123 and then I confirm it with abc123 again, I left the "Create An Annonymous Account" check box uncheked, click next button and on the next screen I click on "execute" button. There are four operation that are been perfomed in the following order.

1. Prepare configuration
2.Write configuration file
3.Start Service
4. Apply security settings.

All operations passed except number 4. The window service is running but I cannot connect to the database.

The Error message says:

"The security setting could not be applied to the database because the connection has failed with the following error.

Error Nr 1045
Access denied for user 'root@localhost'(using password:NO)"

Like said earlier, I entered the password abc123 and the operation failed becuase it thinks I never entred the password. The reason I entered the password becuase I don't know the default password for root.
[29 Mar 2006 12:52] Valeriy Kravchuk
Is it mysql-essential-5.0.19-win32.msi or mysql-5.0.19-win32.zip you have tried to install? Is it a fresh installation or you had some version of MySQL 5.0.x before on that machine?
[8 Apr 2006 0:14] Jim Neely
I have had the exact same problem on my XP Pro.... THE EXACT SAME PROBLEM
[10 Apr 2006 14:13] Syed Ahmed
Here is a work around to this problem.

1) If you have already installed MySQL, uninstall completely and manually clean the registry keys by searhing for "MySQL" key word.

2) re-install MySQL by following the instructions on the screen

3) proceed to create database instance

4) enter the root password as desired on the security configuration screen

5) When error 1045 dialog will apprears click on "Retry" instead of "Cancel". This step is extremly critical, if you click on cancel, you will never be able to recover from the 1045 error nor would you ever be able to create a database instance with the current installation of MySQL.

Clicking on the Retry button worked for me, hopefully it will work for you as well. 

Note: The Retry button must be clicked on the very first attempt to create the database instance when the error 1045 dialog appears. The Retry trick does not work on subsequent attempt to create database instance after cancel button has been clicked, tough the instruction says database instance can be created later on. It simlpy won't work!

Thanks!
Syed A Ahmed
EFJohson Inc.
[29 Apr 2006 13:20] Valeriy Kravchuk
Is that clicking on Retry solve problem for you each and every time? Do you use InnoDB as default database engine? If both answers are "Yes", then your problem is understandable. 

If it is a new instance, not installation over old data, then InnoDB tablespace is created upon first start of the service. It may take some time on slover disks, more than delay before trying to connect at the next step. It is a known and reported problem. Installer should wait and check the error log for InnoDB tablespace creation to complete before trying to connect.
[10 May 2006 16:23] Sheryl Briggs
I am having EXACT same problem but my machine is frozen on the last step "Apply Security Settings".  what do i do I can't retry or cancel?
[29 May 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[13 Jun 2007 16:43] Kirti Roda
I am having same exact problem and pressing "retry" is not working. what should I do? Please help me. I have spent enough time on it.
[14 Jun 2007 9:16] Valeriy Kravchuk
All reporters:

What version of MySQL server do you use? Do you use InnoDB as default storage engine?
[14 Jul 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[23 Oct 2007 22:00] Jonathan Stremming
This absolutely sucks. Ive tried every possible solution Google and MySQL has to offer and I still get the error... Everything works until you get to the #4 on setting up the instance and then it fails. I cannot get into the database with a password. MYSQL is officially sucking at the moment and Im thinking of going back to Access.
[20 Feb 2008 6:03] Jon Julian
You can recover from this error.

Ensure the mysql service is running.
Navigate to the bin directory and issue this command line

mysqladmin -u root password 'new-password'

Once this has been done rerun the configuration and it will work.
[19 Apr 2009 12:23] Oğuz Çelikdemir
If your system Windows VISTA, the problem related with "DATA" directory. The installation creating default data files under "C:\ProgramData\MySQL" directory. I think you have select different directory rather than default so that installation hanging. To resolve this issue, just stop the MySQL service then move above data directory to default installation directory. Change my.ini settings, after that, start MySQL service than set admin password following command :

mysqladmin -u root password "your_password"

Oguz Celikdemir
[18 Aug 2009 16:07] Jonathan Brophy
I have tried SO many different methods SOO many times when I chanced upon a comment about clearing ALL MySQL entries in the Registry prior to installing.
And it WORKED !
[18 Sep 2009 10:06] Mike Smith
Hi,

I installed MySQL 5.1 on WinXP Professional Edition succesfully. But when I tried to do it on a Windows 2003 Server it was like building the Chinese Wall...

Here are the steps that worked for me:

NOTE: I did not have to open TCP port 3306 at firewall.

1. When service startup fails at MySQL Instance Config Wizard, cancel the wizard, go to Services windows and make sure the MySQL Server is stopped.

2. Execute again MySQL Instance Config Wizard (The service should start now)

3. If step 4 fails (Apply Security Settings), cancel the wizard

4. Create a TXT file (i.e. C:\mysqlpassword.txt) with the following lines

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

5. Open a Command prompt (former DOS console) and execute:

"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" --init-file=C:\mysqlpassword.txt --standalone --console

6. Open a different console and execute: "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" -u root -p shutdown (enter the password specified in file mysqlpassword.txt, of course)

3. Execute again MySQL Instance Config Wizard (The security setting should be applied)

Good luck !
[15 Jan 2010 0:25] Roel Van de Paar
See bug #42853
[27 Oct 2010 21:21] Yury Carrero
I had the same problem and I did everything that was said here and had the same results; my configuration is Server 2008, IIS7, MySQL 5.5, Apache 2.2.16. To fix my issue I had to uninstall MySQL, remove the entries from the registry remove all directories for MySQL in the drive and the final caviat was to remove the MySQL from ProgramData directory, re-run the install and woola
[4 Jan 2011 20:36] Michael Lamming
I had the same problem and tried all the same things to no avail.  Finally I followed the recipe above: [18 Sep 2009 12:06] Mike Smith 

That worked for me.

Guys this needs attention or half your users will give up in disgust.

//Mik
[8 Feb 2011 15:36] Valeriy Kravchuk
Please, check if the same problem happens with the latest versions, 5.0.92, 5.1.55 and 5.5.9. 

I was able to install 5.5.9 over 5.5.8 on 64-bit Windows XP without any problems.
[4 Mar 2011 22:00] Maya AKR
In my Windows XP SP2 OS,I tried first to install mysql server using installer mysql-5.5.8-win32 and installation worked fine,but MySQL Instance Config Wizard failed while applying security settings popping up error message Can't connect to MySQL server on 'localhost' (10061).I googled  and tried many ways,but nothing worked.
So I installed mysql server using essential installer package(ie,mysql-essential-5.1.55-win32 in my case) & Selected complete installation.While running MySQL Instance Config Wizard,I selected standard configuration,with both install as windows service and install windows path ticked and mysql server instance was configured successfully.So anyone who gets Can't connect to MySQL server on 'localhost' (10061) in XP SP2 can try this out by using appropriate essential installer package.
[25 Mar 2011 22:08] Sveta Smirnova
Maya,

thank you for the hint.

Bug closed as "Can't repeat" as we could not repeat it and all cases seems to be wrong usage.
[5 Jul 2011 2:42] Ilguiz Latypov
I have the same issue, except that I am getting error 2013.  If I ping localhost using the ping program provided by Windows such as c:\Windows\system32\ping.exe, I see that Windows resolves "localhost" to an IPv6 address.

Should I disable the IPv6 stack in Windows altogether to make MySQL work?  Should the installer change its use of "localhost" with an IPv4 address such as "127.0.0.1"?

Does the installer log its actions?  Perhaps, only "power users" run the MySQL installer, and for them the ability to review the detailed actions performed by it to find the point of failure has more importance than the user interface.

As another work-around to this issue, it would be nice apply the security settings mentioned by the installer by running a script.
[5 Jul 2011 2:52] Ilguiz Latypov
With my suspicion about IPv6 in mind, I disabled the TCP/IP connectivity option in the Instance Config Wizard, enabled the root password change and could see the service restart and the "security settings" apply.

So to work around the issue, one can either clear the "root password" check box to bypass the "security settings" altogether.

If the "apply security settings" progress item does more than setting the root password, its dependency on the "root password" check box prevents from replaying its actions by re-enabling TCP/IP connectivity and disabling the root password change.
[1 Aug 2011 7:47] Francis Manas
Ilguiz Latypov was on the right track, the error popping up is misleading as it points to the ports and firewall, but the key was the localhost and ipv6 as suggested by Ilguiz Latypov.  Check your system by pinging localhost and you should see the usual 127.0.0.1 instead of ipv6 :::1.  Simply disabling does not seem to work and I had to fully uninstall ipv6 from my system to make it work.  Did not even have to reinstall, I just restarted the configurator
[4 Oct 2011 6:26] Firouz Saeidi
Hi
I don't understand in the MySQL configuration what would be the "current root password". ok I understand that the new password is the one that I am going to choose and also confirm it but for the sake of God someone says me what should I do for current root password???
[1 Jun 2012 13:49] Jobin T Philip
This problem occurs because of the existance of old database instance in the system. The ways to fix this is explained in the following blog post.
http://phpladder.blogspot.in/2012/06/mysql-server-windows-applying-security.html
Hope you find it useful.
[12 Jul 2012 7:39] Stanplaat Huge
My problem fixed using comment of Mike Smith. You guys should try his suggestion when faces this problem.

Good Luck