Bug #60552 Cannot apply security settings, cannot connect to server on localhost
Submitted: 20 Mar 2011 18:21 Modified: 14 Nov 2011 10:26
Reporter: Anthony Marston Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Config Wizard Severity:S1 (Critical)
Version:5.5.10, 5.5.14 OS:Microsoft Windows (XP 32 bit)
Assigned to: CPU Architecture:Any

[20 Mar 2011 18:21] Anthony Marston
Description:
I am installing 5.5.10 into a new program folder and data folder. When I get to the Server Instance Configuration Wizard I go through the following steps:
- Detailed configuration
- Developer machine
- Mulfifunction database
- InnoDB tablespace settings - installation path
- Decision Support (DSS)/OLAP
- Enable TCP/IP networking - port 330, add firewall exception
- Enable strict mode
- Best support for multilingualism
- Install as a windows service
- Modify security settings with a new root password
Execute:
- Prepare configuration
- Write configuration file
- Start service
- Apply security settings - FAILS WITH:
"The security settings could not be applied to the database because the connection has failed with the following error:
Error nr. 2003
Can't connect to MySql server on 'localhost' (10061)"

I have tried uninstalling and reinstalling several times with the same result. The log fle contains the following:

110320 17:48:50 [Note] Plugin 'FEDERATED' is disabled.
110320 17:48:50 InnoDB: The InnoDB memory heap is disabled
110320 17:48:50 InnoDB: Mutexes and rw_locks use Windows interlocked functions
110320 17:48:50 InnoDB: Compressed tables use zlib 1.2.3
110320 17:48:50 InnoDB: Initializing buffer pool, size = 47.0M
110320 17:48:50 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
110320 17:48:50  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
110320 17:48:51  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 24 MB
InnoDB: Database physically writes the file full: wait...
110320 17:48:52  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 24 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
110320 17:48:54  InnoDB: Waiting for the background threads to start
110320 17:48:55 InnoDB: 1.1.5 started; log sequence number 0
110320 17:48:55 [Note] Event Scheduler: Loaded 0 events
110320 17:48:55 [Note] F:\MySQL\MySQL Server 5.5\bin\mysqld: ready for connections.
Version: '5.5.10'  socket: ''  port: 3306  MySQL Community Server (GPL)

How to repeat:
Install into completely empty folders on a Windows XP 32 bit machine.
[23 Mar 2011 19:48] Miguel Solorzano
Thank you for the bug report. This is an upgrade installation or the only fresh install of MySQL?. Thanks in advance.
[23 Mar 2011 20:39] Anthony Marston
My system contains a working installation of 5.1.54, but I am installing 5.5 into a fresh directory, including the data directory. I had stopped the 5.1 instance and removed it before installing 5.5, so to all intents and purposes it is a fresh install and not an upgrade.
[27 Mar 2011 19:55] Luís Ferro
I've just tested the latest vertion of the windows installer (5.5.10, win 7).

(New configuration, first time run)

When i run it the first time, it stated that the connection failed.

This was due to a wrong connection type (not using password, when a password was supplied).

The interisting thing is... The service is running, the root user has the password set to the correct supplied password, BUT, the connection is failing.

I reccon that the first scripts that are applied, open a new connection without password and change the root password to the one supplied and flush permissions and close the connection.

Then the next scripts on the config, will try to open a connection, without password and will fail BECAUSE now there is a password in place.

A second time rerun, will fail, because the script doesn't understand that the mysql service was already installed.

Hope that this claryfies what is going on on the Config Wizard, because it's mind boggling (this was working perfectly well in older versions of MySQL).

Cheers,
LF
[31 Mar 2011 1:09] Miguel Solorzano
Could you please look or create the \windows\hosts file with the below line:

127.0.0.1 localhost

and try again. Thanks.
[31 Mar 2011 5:31] Anthony Marston
My hosts file already contains an entry for '127.0.0.1 localhost', and has done for years.
[19 Apr 2011 21:17] Ian Emery
Has this ever been solved?
[20 Apr 2011 0:33] Luís Ferro
The 127.0.0.1 / local loop for localhost is setup.

And works perfectly.

Of notice, this has nothing to do with network.

This has to do with the fact that during the setup, if you specify a password, the setup will run, but only half of it, til the point of setting that password up.

After that, the wizard has to do some more connections to finish applying the security checks, but fails to properly use the supplied password (as it should), and tries to execute the scripts with no password (which naturally fail).

Cheers,
LF
[13 Jul 2011 23:08] Miguel Solorzano
Could you please try with latest released version. Thanks.
[14 Jul 2011 8:55] Anthony Marston
I have tried and failed with every new version up to and including 5.5.14
[17 Jul 2011 12:18] Valeriy Kravchuk
Please, send my.ini file that is generated by Config. Wizard (should be in "C:\Program Files\MySQL\MySQL Server 5.5\" directory).
[17 Jul 2011 14:27] Anthony Marston
my.ini created by 5.5.14 installer

Attachment: my.ini (application/octet-stream, text), 8.66 KiB.

[26 Jul 2011 23:18] samuel varghese
Has this been resolved?
[27 Jul 2011 8:55] Anthony Marston
This problem is still outstanding. Even if I go through the whole installation prcedure without modifying the security settings I still get the message "cannot connect to server on localhost" with whateer software I try - MySQL Workbench, MySQL Administrator, or a PHP program.
[13 Nov 2011 19:13] Valeriy Kravchuk
Please, check if this still happens in your environment with a newer version, 5.5.17 (use MySQL Installer 5.5.17).
[13 Nov 2011 19:32] Anthony Marston
I don't get an error woth the security settings, but I still canot connect to the server. This has been reported separately in bug #61824
[14 Nov 2011 10:26] Valeriy Kravchuk
So, apply security settings part is no longer repeatable, and we have open bug #61824 for cannot connect part.