问题
I'm using Windows 7 and running XAMPP MySQL SVC service. I'm seeing the following error:
Windows could not start the Mysql service on Local Computer.
Error 1067: The process terminated unexpectedly.
What does this mean, and how can I fix it?
回答1:
Examine error log (start eventvwr.msc). MySQL typically writes something to the Application log.
In very rare cases it does not write anything (I'm only aware of one particular bug http://bugs.mysql.com/bug.php?id=56821, where services did not work at all). There is also error log file, normally named .err in the data directory that has the same info as written to windows error log.
回答2:
You need to:
- stop the MySQL service:
- Open
mysql path\data
- Remove both
ib_logfile0
andib_logfile1
. - Restart the service
回答3:
I had the same problem. I am using mysql 5.6.11. To solve this problem I had to change my-default.ini file in mysql-5.6.11-win32 folder So I just pasted the following lines under line [mysqld]
basedir="D:\mysql-5.6.11-win32\"
datadir="D:\mysql-5.6.11-win32\data\"
port=3306
server-id=1
bind-address=127.0.0.1
Options basedir and datadir need to be modified for mysql location.
回答4:
Don't forget to check
innodb_data_home_dir = <your_directory_location>
innodb_log_group_home_dir = <your_directory_location>
on my.ini files. Wrong set value for these two variable make mysql process terminated and produce error 1067
. Also check eventvwr.msc
and mysql_error.log
for detail error.
回答5:
I had the same problem but I was confused with @Vladislav's answer and couldn't seem to find the solution from that. Of course, my problem may not be exactly the same as I encountered the problem when trying to upgrade XAMPP, but it also gave the same Error 1067 message.
With further search I found this:
https://serverfault.com/questions/214435/error-1067-the-process-terminated-unexpectedly-when-trying-to-install-mysql-on
The answer from that is straightforward, that is, to completely clean up the folder, which doesn't always happen. As in regards to XAMPP, I guess I backed up the necessary files first (data folder from mysql folder and the htdocs folder). Uninstall XAMPP. Check the xampp folder for any content that remains and delete everything. You may want to reboot afterwards, just in case. Then reinstall XAMPP. Copy the backed-up folders back to their respective places, and hopefully, mySql will work again in XAMPP.
This should solve the issue.
回答6:
Same problem here. After analysing log reports via eventvwr.msc I found, that logging files were placed in folder which requires admin rights to update, so files cannot be created and install and startup process could not proceed.
So checking eventlog was very usefull.
回答7:
I get this problem from time to time, and when I do, I have been able to solve it by using a backup of the database folder(s) that give the problem.
When you check your 'Event Viewer > Windows Log > Application', if you see an error:
InnoDB: Attempted to open a previously opened tablespace. Previous tablespace [database]/[table] uses space ID: 59 at filepath: .\[database]\[table].ibd. Cannot open tablespace [different db]/[different table] which uses space ID: 59 at filepath: .\[different db]/[different table].ibd
Then what works for me, is delete the first mentioned [database] folder in your MySQL data directory, and copy the backup of that database folder to where it was previously.
Then start MySQL, and it starts again for me, without this 1067 error.
回答8:
I had practically the same problem. in the log file I found this:
110903 9:09:39 InnoDB: 1.1.4 started; log sequence number 1595675
110903 9:09:40 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect key file for table 'user'; try to repair it
Apparently the user table has been corrupted. I replaced it with another copy (user.frm ; user.MYD ; user.MYI in mysql\data\mysql)
and thats works for me.
ps: am using xampp.
回答9:
Search and destroy (or move cautiously) any my.ini files (windows or program files), which is affecting the mysql service failure. also check port 3306 is used by using either netstat or portqry tool. this should help. Also if there is a file system issue you can run check disk.
回答10:
I just went throught same issue and I solved it the following way. 1 - found the .err file which logs all mysql issues, in win7, located under programData\MySQL\MySQL Server 5.6\data\ 2 - Check the last entries from the file and, in my case, I found the error was coming from a flag (audit-log) that I set to "true" from the workbench interface the day before! 3 - went into the my.ini file, and removed audit-log=ON. 4 - launched mysql service and it worked!!
回答11:
I've got the same problem, and what worked for me is in THIS OTHER ANSWER.
I didn't replicated it here because it is NOT A CORRECT THING TO DO.
Basically is a re-install being sure to delete everything very well and using 32 bit versions.
回答12:
I had the same error. I checked the error logs: C:\ProgramData\MySQL\MySQL Server 5.5\data\inf3rno-PC.err
. According to them
170208 1:06:25 [Note] C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld: Shutdown complete
170208 1:10:44 [Note] Plugin 'FEDERATED' is disabled.
170208 1:10:44 InnoDB: The InnoDB memory heap is disabled
170208 1:10:44 InnoDB: Mutexes and rw_locks use Windows interlocked functions
170208 1:10:44 InnoDB: Compressed tables use zlib 1.2.3
170208 1:10:44 InnoDB: Error: unable to create temporary file; errno: 2
170208 1:10:44 [ERROR] Plugin 'InnoDB' init function returned error.
170208 1:10:44 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170208 1:10:44 [ERROR] Unknown/unsupported storage engine: INNODB
170208 1:10:44 [ERROR] Aborting
I think the important part here
170208 1:10:44 InnoDB: Error: unable to create temporary file; errno: 2
I changed the TMP
and TEMP
env variables from C:\Windows\Temp
to %USERPROFILE%\AppData\Local\Temp
yesterday, because I was unable to compress a directory and according to many post the solution is that. Now compression works, but mysql and apparently nod32 complains that they cannot create temporary files...
I added tmpdir=c:/server/mytmp
to C:\Program Files\MySQL\MySQL Server 5.5\my.ini
. And after that started the service again with services.msc. It is okay now.
So this can be a possible cause as well. I strongly suggest to everybody encountering this problem to check the error logs.
回答13:
I use install file to repair. it works for me
回答14:
please check the space available on drive where the db is stored. in my case it was stopped the service due to less space on drive.
回答15:
There are many solutions for the problem. This worked for me
Right click on Service -> Properties -> Log on as system account.
来源:https://stackoverflow.com/questions/4758844/error-1067-the-process-terminated-unexpectedly-when-trying-to-start-mysql