MySQL Forums
Forum List  »  Install & Repo

Re: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Posted by: Mark Hughes
Date: April 08, 2010 09:43AM

It took me 3 days of reading forum posts, the manual, and testing to get MySQL installed and the Server Instance configured correctly. I installed MySQL 5.1 Community Server on a standard PC running Windows XP SP3. This is what worked for me:

I downloaded the .msi install file (mysql-essential-5.1.45-win32.msi) from mysql.org. That file does a few things:

* It installs the MySQL Server software.
* It installs the MySQL Server Instance Configuration Wizard, which you then use to configure the server instance. This is more complex, and more likely to be the source of problems than the actual install of the software.

I double clicked on the file - that starts the MySQL Setup Wizard. So, I select 'Typical' setup type, click 'Next', and then click 'Install'. Shortly afterward, I get the Wizard Completed screen.

The Install is complete, no problems. That's the easy bit. Its the next bit - the Server Instance Configuration that gives me trouble.

I can configure the server now, by clicking 'Finish' on the last Setup Wizard screen. This starts the Server Instance Configuration Wizard. Or, I can configure the server later, by starting the Server Instance Configuration Wizard later via Start, All Programs' MySQL, MySQL Server 5.1, MySQL Server Instance Config Wizard. Either way, sooner or later............

I start the Server Instance Configuration Wizard. This Wizard does 3 things:

* generate an optimized MySQL config file
* set up a Windows service running on a dedicated port
* set the password for the root account

Its a more complicated process than the simple install I've already done - the Server Instance Configuration Wizard has 11 screens I work through:

Screen 1: Welcome. I click 'Next'

Screen 2: Select configuration type. If you select 'Standard', you'll skip the next 6 screens. I select 'Detailed Configuration' and click 'Next'.

Screen 3: Select server type. I select 'Developer Machine' and click 'Next'.

Screen 4: Select database usage. I select 'Multifunctional Database' and click 'Next'

Screen 5: Select the drive for the InnoDB data file. If I accept the existing setting here - that is if I don't specify a different location for my data files, then this attempt to configure the server instance will FAIL!!

That's right, if I make no changes here, click on 'Next' and keep going through this Wizard, on the 11th and final screen it will FAIL on the third item (Start Service). The Windows MySQL service will be created, but this configuration wizard will not be able to start it.

And if I go to the Windows Service list (under Administrative Tools in Control Panel) I cannot start the Windows MySQL Service manually there either – I get 'Error 1067: the process terminated unexpectedly'. And if I try and start the Windows MySQL Service from the Command line, I also get the 1067 Error.

But if I change the location of the InnoDB data file here on Screen 5 of the Server Instance Configuration Wizard, then the 1067 error does not occur at the end of my configuration!

Well, its bad system design to store your data in the same place as your programs anyway. So, I set up a new folder for my data somewhere else, use this screen to point to that new folder, and then I click 'Next'.

Screen 6: Number of Concurrent Connections. I select 'Decision Support (DSS)' and then click 'Next'.

Screen 7: Networking Options. I enable TCP/IP on port 3306 and click 'Next'

Screen 8: Default character set. I select Standard Character Set, and click 'Next'

Screen 9: Set the Windows options. I select Install As a Windows Service, and also Include Bin Directory in Windows PATH, and click 'Next'.

Screen 10: Set the security options. There are three possibilities here:

* You are doing a first configuration after a new install – you will see 2 password boxes, so you can type in your new password, and then re-type it.

* You are doing a re-configuration after a new install – you will see 3 password boxes, 1 for the old password, and 2 for a new one if you want to change the password. If you can't remember the password you used in the earlier configuration, then you can't put it in correctly here in the current password box, and this configuration attempt will FAIL!!

* You THINK you're doing a first configuration after a new install, because you uninstalled MySQL Server and started again from the beginning. But you see 3 password boxes – 1 for the current password, and 2 for a new one. If you can't remember the password you used in the earlier configuration, then you can't put it in correctly here in the current password box, and this configuration attempt will FAIL!!

In the last two options, you will get an error on the 4th item (Apply security settings) on Screen 11 (the final screen) of this Configuration Wizard because whatever you put in the current password box doesn't match the password you created in an earlier configuration attempt.

If you left the Current password field blank this time, you see:
Error No. 1045 Access denied for user 'root'@'localhost' (using password NO)

If you put a password into the Current password field, you see:
Error No. 1045 Access denied for user 'root'@'localhost' (using password YES)

Now...let me guess.....you're not reading these forum posts about Installation and Configuration problems because everything worked for you first go round – right? You're here 'cause you've tried to re-install and reconfigure MySQL several times unsuccessfully, you can't remember what password you used on your original attempt (or if you left it blank) and you're starting to get brain-fade :)

As far as I can determine from my testing, if you do a normal Windows Uninstall of MySQL Server, some files will remain in more than one location on your PC, and at least one of those files will contain the old password. So although you THINK you're doing a complete new installation and configuration, MySQL is still finding a file with the old password.

The solution for me was to do an Uninstall so carefully that I removed ALL traces of ANY earlier attempts at Installation and Configuration. This is what I did:

1.Used the normal Windows 'Add or Remove Programs' in Control Panel to uninstall MySQL Server.
2.Deleted the MySQL Server folder and files from C:\Program Files\MySQL.
3.Deleted any files the system had created in the data files location I specified on Screen 5 of the Wizard.
4.Deleted the MySQL Server folder and files from C:\Documents and Settings\Administrator\Application Data\MySQL
5.Deleted the MySQL Server folder and files from C:\Documents and Settings\All Users\Application Data\MySQL
6.Used the Registry Editor (Start, Run, regedit) to delete the MySQL Server folder/keys from HKEY_LOCAL-MACHINE
7.Emptied the Recyle bin.
8.Used Disk Cleanup (under All Programs, Accessories, System Tools) to delete any temporary files.
9.Re-booted the PC

Then, I started a new Installation and Configuration from the beginning. The Setup Wizard did the installation with no problems. In the Server Instance Configuration Wizard, I remembered on Screen 5 to change the location of my data files.

On screen 10, there were only the 2 boxes for a new password; no box for a current password, so I was pretty sure I'd been successful in deleting all traces of old installations. So, I put in my new password twice, and clicked on 'Next'

Screen 11: Ready to execute. Click on 'Execute'

Finally, I get 4 ticks showing that the following are all OK

* Prepare configuration
* Write configuration file
* Start Service
* Apply security settings

This is what worked for me. I don't know if it will fix any Install / Configuration problems for you – but good luck!

Mark.

Options: ReplyQuote


Subject
Written By
Posted
June 27, 2009 08:29PM
December 16, 2007 02:18AM
December 27, 2007 02:08PM
January 16, 2011 06:51AM
August 27, 2009 12:22AM
Re: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
April 08, 2010 09:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.