Bug #36491 error 1045--connection error
Submitted: 4 May 2008 10:34 Modified: 1 Jul 2008 20:48
Reporter: zeyi he Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.1.24-rc-win32.zip OS:Any
Assigned to: CPU Architecture:Any

[4 May 2008 10:34] zeyi he
Description:
I installed mysql-5.1.24 in my computer which is on windows XP home edition pack 2. When the program ran to the last step of MySQL Server instance config, it can't go through with "apply security settings", although i open the TCP port 3306 before i started this install program.

The prompt show that"the security setting could not be applied to the database because the connection has failed with the following error:
Error N.1045
Access denied for user 'root'@'localhost'(using password:NO)
If a personal firewall is running on your machine, please make sure you have opened the TCP port 2206 for connections, otherwise no client application can connect to the server. After you have opened the port please press retry to apply the security settings. (I am sure i have opened this port!)
If you are re-installing after you just uninstalled the mysql server please note that the data directory was not removed automatically. therefore the old password from you last installation is still need to connect to the server. in this case please select skip now and rerun the configuration wizard from the start menu.(but this is my first time to install mysql!)

Please fix it, i am a newbie! thanks for help!

How to repeat:
install mysql-5.1.24 in windows xp, 
use automatical to install mysql server instance config, 
on the last step--apply security settings,
this bug happened.
[4 May 2008 11:25] Peter Laursen
I had this several times too with installers for recent server versions on Vista.

Now you can skip the configuration wizard and configure manually, so I did not consider it a big problem and did not report it (but 'newcomers' to MySQL will of course not realize that configuration wizard errors are not that critical). 

Anyway .. installer software and what is bundled with it is supposed to work properly - or is it?

Peter 
(not a MySQL person)
[4 May 2008 14:00] Valeriy Kravchuk
What port you had opened, 2206 as your error message says according to your report, or 3306 as you had written initially?

Had you ever installed other MySQL version on that machine?
[4 May 2008 14:26] Peter Laursen
@valeriy ...

this is *so easy* to reproduce witht every recent server isntaller ...
.. I will upload an image
[4 May 2008 14:27] Peter Laursen
config wizard fails.

Attachment: secsettings.jpg (image/jpeg, text), 95.13 KiB.

[4 May 2008 14:35] Peter Laursen
What I did was simply to uninstall, delete every folder/file belonging to this version and install.  This was with server 6.0.4, but could be any recent, I believe.

I think it happens consistently it you select (in the last wizard screen) NOT to allow root access from remote machines. 

Further I DID 'change security settings' and entered a pasword and DID NOT create an anonymous account. (more details: developer machine, utf8, decision support).  I installed this server to listen on port 3309.

I have seen it SO MANY times before - everytime I try to use that crap wizard - so I simply stopped using it!!

I also think your question the Zevi is misplaced.  You only enter the port once during install, so there is no chance for a mismatch!  It is obviously a typo only!
[4 May 2008 14:55] Peter Laursen
options file after step 3 of the wizard

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

[4 May 2008 15:01] Peter Laursen
'apply security settings' were cancelled in the dialogue and the my.ini was like attached.

The server had generated BOTH users 'root'@'localhost' and a 'root'@%' (plus a 'mutex'@'localhost' and a 'somebody'@localhost, but those thwo are probably somethingspecial for 6.0!) even though i DESELECTED option to let root connect from remote.  So this was probably the security setting that failed to apply!

I think there must be some client program bundled with this installer since it claims to be able to drop 'root'@%', but it does not work!
[4 May 2008 15:04] Peter Laursen
@Valeriy ... you had what feedback you need!

I think Zevi has not MySQL routine enough to sort out this!
[4 May 2008 15:34] Peter Laursen
@Zevi ...

please post something .. anything.  Only you can change the status from 'need feedback' to 'open'.
[4 May 2008 21:48] zeyi he
Hi, thanks for your reply. sorry for delay to response!
what should i do to solve my problem, upload the file my.ini you provide? or should i download version 6.0 to use?

Yes, i am a new for mysql, so sorry for some unprofessional description!
[5 May 2008 4:20] Valeriy Kravchuk
Peter,

I tried to repeat, with 6.0.4, based on your description on XP Home SP2, after uninstallation of 6.0.4 for that your other bug report and removing all remaining files/directories from "c:\Program Files\MySQL\MySQL Server 6.0". I checked that "firewall" related check box. And I was NOT able to get error 1045. 

6.0.4 installed and works as expected, as well as dozens of older 5.0.x and 5.1.x versions I ever installed during last 2+ years in a "clean" XP environment, with all files in the target basedir directory removed.

As for accounts created when anonimous and remote root login are not enabled, I've got:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot -proot test -P3311
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 6.0.4-alpha-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select host, user from mysql.user;
+-----------+------+
| host      | user |
+-----------+------+
| localhost | root |
+-----------+------+
1 row in set (0.00 sec)

What I am doing wrong? Looks like this report needs more details or other person to understand them.

Installing over data directory remaining from the other/previous installation and attempts to change root password/security settings/remote root access had led to 1045 many times for me also, but this is a different situation, IMHO.

I leave this report "Open".
[5 May 2008 7:49] Peter Laursen
For me it is consistently reproducable! And my screenshot is clear enough I think!

If I understand this, there must be some small client program bundled with the installer, so that 'security settings' can be applied (ie the user 'root'@'%' deleted from the `mysql`.`users` table).  

This client program seems to fail to authenticate in some situations.
[5 May 2008 8:05] Tonci Grgin
Zeyi, Peter. Please be patient for just a little while. It seems one of my colleagues was able to repeat the 5.1.24 config wizard problem described here. I will have to consult with him.

In the meantime and for sake of completeness, I would like to know:
 - Did you use .msi for installation?
 - Did any of you run mysql_fix_privilege_tables.sql script?
[5 May 2008 8:45] Peter Laursen
The installer I installed was a 'setup.exe' downloaded as a zipped archive.
I think it must be from this link:
ftp://mirrors.dotsrc.org/mysql/Downloads/MySQL-6.0/mysql-6.0.4-alpha.zip

As it was a *completely clean install* I did not execute neither mysql_upgrade nor the *fix_privileges* script.
[5 May 2008 9:25] zeyi he
The installer i used on my labtop is setup.exe, but i also used the .msi in my desktop, both of them were 'completely clean environment', never installed mysql or any sql software before. 

Peter, maybe it is a tiny problem, may i ask you how i can avoid this to use mysql? thanks.
[5 May 2008 9:35] Peter Laursen
@zeyi

You just ignore this error (click 'cancel').  The server will be installed and running and you can connect with any client and you can delete the 'root'@'%' user if you want only to be able to connect as 'root' from the local machine.  This is the only thing that the 'configuration wizard' bundled with the installer failed to do here.

So it is not really a big problem.  But if you do not know MySQL then of course such errors can be very confusing and make you uncertain.
[15 May 2008 15:05] Kokouvi Koumassi
Hello,

I would appriciate if we can know how many people have installed successfully this version of MySQL on XP machine without the error

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

In my case, I have XP machine with no personal firewall.
Thanks for your cooperation.
[15 May 2008 16:54] Kokouvi Koumassi
I have decided to forget this version and returned back to 5.0.51b. No security error during the installation which makes sense for me. Sorry to all of you, I need to store data in database and not to troubleshooting the installation problem.

Thanks
[17 May 2008 4:07] Nikolaos Nikou
I experience the same problem with server 5.0.51b and Vista. I am trying thelast few days to find a solution on google and on MySQL site but I have only find similar complains with no fix.
I do not understand this, I have installed MySQL several times before and haven't seen this.
The last few versions coming from MySQL all have installation problems. 
It seems that the quality is dropping.
It is not a firewall issue, I have disabled the firewall and I am using the standard port 3306.
I am guessing that the configuration wizard is not setting properly the root user (password, access).
We had similar problems with Administrator that couldn't create properly users for years, at least on MacOSX. Only last year the bugs were fixed. So if I had to guess is that someone did the same mistake with the wizard but then I am not an expert.
The error is so easily reproducible, clean install on clean system create a useless installation each time.
[28 May 2008 10:47] Tonci Grgin
Same problem reported in Bug#34947 (NoF).
[4 Jun 2008 7:42] Huy Hoang
Hi,
I was faced this bug when downgrade from mysql 6.0 alpha to mysql-5.1.24rc version. 
My solution is turn off mysql configuration settings after it fails to set up "apply security settings".
Try to connect to mysql using "MySQL Query Browser" using 
user is root, password is the password you fill in the previous step (configuration step) and schema is mysql.
It should be connected successful.
After that try to execute this query:

CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';

And now, you can come back to use configure wizard without "apply security settings".
This solution is referenced from another bug:
http://forums.mysql.com/read.php?11,142598,160503#msg-160503.
My conclusion is when you install mysql 5.1.24rc, the mysql database, for some reasons, is installed without "servers" table. It make the wizard can't configure.
Hope this help.
[18 Jun 2008 14:56] MySQL Verification Team
Applying security settings

Attachment: security-settings.PNG (image/png, text), 27.02 KiB.

[18 Jun 2008 15:03] MySQL Verification Team
I was able to install->removed->re-install without problems on XP the package 5.1.25. I will test on Vista Ultimate.
[30 Jun 2008 17:34] MySQL Verification Team
Security Setting on Vista Ultimate

Attachment: secrurity-setting-vista.png (image/png, text), 52.61 KiB.

[1 Jul 2008 20:48] Sveta Smirnova
Thank you for the feedback.

I also could not repeat described behavior if data directory does not exists in time of configuration.
[10 Oct 2008 7:11] karthik chigurupati
I encountered the same probolem while upgrading from sql server 5.0.51b - sql server 5.1.28. I tried out many ways and many times.
one thing worked out for me.

I installed by checking the firewall option(still it fails).If you have already installed previous version and uninstalled it and installing a latest new version.Clean the folder c-->program files-->mysql.As you have already uninstalled previous Mysql version, in the password section you will keep previous root password blank and continue. Close the wizard when the error 1045 is thrown at you by cancel button.

next run the MySQL instance confirg wizard and follow the same steps this time add previous password to the password you have given to configure for the first time. It worked this way.
[9 Dec 2008 19:34] Bob Hansen
Are you entering in the right password? By default the password is blank (I think). This bit me and I got the same error message. Blank password worked.
[14 Feb 2009 8:54] Anupam Jain
I have been trying to resolve this problem since last night. Finally got it through:

I have Vista Home Basic. Was getting this error 1045 on the fourth step(apply security settings). Even uninstalling the whole thing and deleting the program file\mysql folder also didnt help. When I tried to install it again, it gave the same error. I could not log into root because it said access denied. It would not do anything if I use the option of skip grant tables so could not reset the root password, so basically I was stuck !

Finally got it to work by finding out that there is *another* folder named C:\ProgramData\MySql in Vista (please note that this is not Program Files, it's ProgramData) This folder is hidden. When I deleted this MySQL folder also(after uninstalling) and tried installing again, whooa! I could log in using (blank) password for root. (though the 4th step still gave an error but alteast I could log into root from command line)

Hope this helps someone !

thanks much,
Anupam
[17 Jun 2009 8:53] Christina Charlton
I had this same problem with Vista. I fixed it by logging into mysql command line client using no password, as the password I set up wouldn't let me in. I then changed my password in mysql command line client. When I ran the config wizard again I had no problems.
[29 Jun 2009 16:47] Antony Meyn
I resolved the problem by doing the following (Vista).

Uninstall MySql via "Programs & Features"
Uninstall the service using the following command at command line ">sc delete MySql"

Delete C:\ProgramFiles\MySql
Delete C:\Programdata\MySql

Re install with port3306 enabled with proxy checked.
[26 Feb 2010 3:08] shiva srikanth
Hi peter,

I followed you instructions uninstall and delete all files of mysql, and i installed again, now i did not get any errors thank you peter.
[14 Oct 2010 10:05] G G
For me the solution was to use the same password what I used for the first time.
[3 Sep 2011 18:38] Knell Villena
The following will resolve this error in Windows 2003

1. Uninstall MySQL
2. Delete C:\Program Files\MySQL
3. Delete path to the database root. In my case, it is C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.5/Data