14

I've run into a brick wall trying to install MySQL v5.5 on my machine.

My PC is Windows 7 x64, Enterprise edition.

MySQL installs fine, but when I run the "MySQL Instance Configuration Wizard", it pauses forever on the step "Start Service" (I can let it run for 30 minutes with no response). If I go into services, I see that the "MySQL" service hasn't started, and if I try to start it, it says "Windows could not start MySQL Service on Local Computer. Error 1067: The process terminated unexpectedly."

I've tried the following:

  • Turning off firewall.
  • Uninstalling all antivirus software.
  • Installing / reinstalling 32-bit version of MySQL.
  • Installing / reinstalling 64-bit version of MySQL.
  • Uninstalling, deleting the contents of "C:\program files\MySQL" and "C:\program files (x86)\MySQL", reinstalling.
  • Checking to see that there is no rogue services named MySQL???? (from a previous install).
  • Checking that port 3306 is not used by an alternate program.
  • Changing the default port that MySQL uses.
  • Checking for "my.ini" and "my.ini.cnf" in "C:\windows" (nothing there but that can cause a problem).
  • Running both MySQL installer, and configuration wizard, in "Adminstrator mode".
  • Turning off UAC.
  • Installing with defaults, not changing anything.
  • Rebooting my machine (about 6 reboots so far).
  • Opening up port 3306 in the firewall (both TCP and UDP, inbound and outbound).
  • Swearing at the klutz of a programmer who designed MySQL so you can't even install it (as if that would help!)

My machine is working 100% in every other way. InfiniDB (a MySQL compatible database) installs 100%, as does Visual Studio 2010, Microsoft SQL Server, etc, etc.

Your advice on how to work around this?

p.s. Here is the screen it got stuck on for 15 minutes until I killed the process:

alt text

Update 2010-12-20

Tried MySQL v5.1, it didn't work either. Its amazing - if you type "mysqld /?", or "mysqld -help", it doesn't give you any help. And, if you try to restart the service manually, it doesn't display any error messages. Could it be any more unhelpful?

Update 2010-12-21

Installed MySQL 6.0 alpha, and it worked. However, I'd rather not use an alpha release, given that the "stable" release is anything but :(

Update 2010-12-21

Found http://dev.mysql.com/doc/refman/5.1/en/windows-troubleshooting.html, dealing with troubleshooting under Windows.

Discovered that you can generate an error log if the service doesn't start - see here: http://dev.mysql.com/doc/refman/5.1/en/error-log.html

Update 2010-12-21

Aha! A clue. To actually see the error, add "--console":

mysqld --console

This returns:

101221 13:57:28 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use Windows interlocked functions
InnoDB: Compressed tables use zlib 1.2.3
101221 13:57:28  InnoDB: Initializing buffer pool, size = 203.0M
101221 13:57:28  InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 56623104 bytes
InnoDB: than specified in the .cnf file 0 106954752 bytes!
101221 13:57:28 [ERROR] Plugin 'InnoDB' init function returned error.
101221 13:57:28 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
101221 13:57:28 [ERROR] Unknown/unsupported storage engine: INNODB
101221 13:57:28 [ERROR] Aborting
101221 13:57:28 [Note] mysqld: Shutdown complete

Update 2010-12-21

It now installs properly. See the answer below.

Contango
  • 1,130
  • 5
  • 15
  • 31

8 Answers8

11

Here's how I fixed the problem:

Step 1: By default, its impossible to find out the reason why the service is failing to start. So, tell it to start in non-service mode, and pipe errors to the console:

mysqld --console

Step 2: In my particular case, I had to delete the contents of:

C:\ProgramData\MySQL

... then reinstall. The MySQL v5.5 installer has a bug: if you uninstall MySQL v5.5 to fix a problem with a bad installation, it fails to clean up C:\ProgramData\MySQL, meaning that it is impossible to install MySQL v5.5 on that machine, from that moment on, without deleting this rogue directory.

Hints:

  • Ensure you kill any instances of "mysqld" in the process monitor.
  • To remove any existing services, use "sc delete MYSQLxx".

Open letter to the MySQL development team at Oracle:

---start open letter to Oracle---

Dear MySQL dev team at Oracle:

If, when MySQL is installed, the service fails to start, please let us know why by either (a) pointing us in the direction of the error log or (b) displaying this error log.

Failure to do so casts Oracle in an incompetent light.

Yours sincerely,

Everyone that installs MySQL on Windows.

---end open letter to Oracle---

Contango
  • 1,130
  • 5
  • 15
  • 31
3

I agree with Gravitas but you do not need to do a re-install (especially when installing MySQL
Server x.x in a different folder other than the default in C:/Program Files/).
These steps helped me run the service successfully.Worked in Win7 x64 so I assume x32 will be just fine :)

Open 'my.ini' file where MySQL Server x.x is installed (mine was 5.5 but 5.1 is also OK)
Go to the line where it says:

datadir=C:/ProgramData/MySQL/MySQL Server x.x/data -> (This is the default path)
Change the above line with something like this:
datadir="<Drive_Letter>:/path/where/MySQL/is/installed/MySQL Server x.x/data/"

Copy all contents of C:/ProgramData/MySQL/MySQL Server x.x/ to the newly designated datadir
EXCEPT ib_logfile0 & ib_logfile1 (relocate them elsewhere as a backup).
Delete C:/ProgramData/MySQL/MySQL Server x.x/.
Re-run MySQLInstanceConfig.
Check TCP/IP networking but DO NOT change security settings (leave them unaltered).
Start service (ib_logfile(1,2) will be regenerated).

P.S.:Reboot and clean temporary files -after reboot- with CCleaner. For some (weird?) reason, you cannot connect to MySQL DBMS from an IDE or MySQL Workbench CE x.x after applying the above settings until rebooting.

NOTE:Editing security settings will cause the configuration utility to hang due to another bug
introduced when enabling TCP/IP with any other setting(s).

Hope this helps!

Kounavi
  • 131
  • 4
2

http://mydailytech.com/post/how-to-fix-mysql-error-1067/

check and follow the above link - it should resolve as it did in my case.

Hope that helps

Mutahir
  • 2,347
  • 2
  • 32
  • 42
  • Sorry, this didn't resolve the issue. I even tried reinstalling it in C:\MYSQL55\ just to make sure that long filenames didn't alter things, rebooting my machine, etc. I'm beginning to wonder if MySQL v5.5 and earlier is just plain broken under Windows 7 x64? – Contango Dec 21 '10 at 13:11
2

Quoted from the website that rigatum posted:

When installing MySQL, if you install it in a non-standard directory, then you’ll need to specify where your defaults file’s path is before you can run MySQL or install the MySQL service, otherwise you’ll get Error 1067.

First let’s open up the command prompt. Navigate to your MySQL install folder and find wherever mysqld.exe is. Then run this:

mysqld –remove MySql

That will uninstall the MySQL service. Now reinstall the service with the defaults-file parameter:

mysqld –install <service name> –defaults-file=<full path of “my.ini” file>

For example:

mysqld –install MySql –defaults-file=c:\mysql\my.ini

Enjoy your error-free MySQL install.

AliGibbs
  • 2,303
  • 20
  • 34
  • Sorry, this didn't resolve the issue. I even tried reinstalling it in C:\MYSQL55\ just to make sure that long filenames didn't alter things, rebooting my machine, etc. I'm beginning to wonder if MySQL v5.5 and earlier is just plain broken under Windows 7 x64? – Contango Dec 21 '10 at 13:13
  • 1
    no its not plain broken at all, i have it working flawlessly on 65 dev windows 7 machines at work, 18 servers (both nix and windows 2008R2), and on my home computers mix of windows 2008 and seven. i think it is not uninstalling something properly and which is why it is getting stuck at some point - happened to me but that was a while ago. I had uninstalled, manually deleted all mysql directories and deleted the service instance too from windows. – Mutahir Dec 21 '10 at 13:19
2

And I just add - not only programdata\mysql must be deleted in this case but also innoDB folder: \mysql datafiles

tomas
  • 21
  • 1
2

For the record, I tried for several hours to get 5.5.20 to install on Windows 2008 64bit. It never would start. I tried every example I could find to fix. Including the accepted answer on here. Never worked.

So I downgraded to 5.1.61 and it worked like a champ. First time.

cbmeeks
  • 243
  • 1
  • 4
  • 11
2

What I did was

  1. With the daemon not running, I rename the data folder under the Program Data\MySQL to something else.
  2. Uninstall mysql from control panel
  3. Re-install. In configuring security settings fails with error #1045. I checked that MySQL has been installed as a service and the root password was blank. I verified this by running mysql utility without username When prompted to retry or skip, I clicked skip and clicked back button until the dialog where you specify current root password and new password. I remove the password in the current root password field as this is blank already and supplied my new root password. Configuration proceeded with no more errors
  4. Stop the service
  5. Copy the database folders from the old data folder which was renamed. Did not copy the log files and ibdata file.
  6. Paste the folders to the current (new) data folder.
  7. Restarted the service
  8. Test in mysql utility to see if the database will be shown which it did.

Btw, I dumped the database with mysqldump --all-databases just in case :)

John Gardeniers
  • 27,262
  • 12
  • 53
  • 108
2

Adding the logical innodb_flush_method=normal to my.ini worked for me. I'm on Windows 7 x64 running MySQL 5.7, moving databases to a 3TB HDD. A quick walkthrough:

  1. Stop the service in the Windows command prompt with net stop sqlXX
  2. Copy over the data folder with the command xcopy "C:\ProgramData\MySQL\MySQL Server X.X\data" "<new_directory>\data" /s
  3. In "<new_directory>\data" delete ib_logfile0 and ib_logfile1
  4. Open C:ProgramData\MySQL\MySQL Server X.X\my.ini, set datadir="<new directory>/data", add innodb_flush_method=normal at the bottom of the file, and save
  5. Restart the service with the command net start mysqlXX

Here the XX is your version number. I'm using 5.7, so I used net start mysql57.

According to the linked discussion, the default value for this is innodb_flush_method=unbuffered, which depends on a 512 byte sector size, which is normal for <2TB HDDs. If the HDD is >2TB, it will usually be formatted with 4096 byte sectors, causing the 1067 error.

I'd tried all of the above too and this is the only thing that solved it.

http://bugs.mysql.com/bug.php?id=28913

dcmorse
  • 131
  • 4