XAMPP - 错误:MySQL 意外关闭
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15169861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
XAMPP - Error: MySQL shutdown unexpectedly
提问by cgf
I have reinstalled XAMPP for some reason and MySQL is not working, giving the following error in the console:
由于某种原因,我重新安装了 XAMPP,但 MySQL 无法正常工作,在控制台中出现以下错误:
01:56:03 [mysql] Error: MySQL shutdown unexpectedly.
01:56:03 [mysql] This may be due to a blocked port, missing dependencies,
01:56:03 [mysql] improper privileges, a crash, or a shutdown by another method.
01:56:03 [mysql] Check the "/xampp/mysql/data/mysql_error.log" file
01:56:03 [mysql] and the Windows Event Viewer for more clues
When checking the "/xampp/mysql/data/mysql_error.log" file I get:
检查“/xampp/mysql/data/mysql_error.log”文件时,我得到:
130302 1:48:06 InnoDB: Waiting for the background threads to start
130302 1:48:07 InnoDB: 1.1.8 started; log sequence number 1600324627
130302 1:48:07 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130302 1:48:07 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130302 1:48:07 [Note] Server socket created on IP: '0.0.0.0'.
130302 1:51:12 [Note] Plugin 'FEDERATED' is disabled.
130302 1:51:12 InnoDB: The InnoDB memory heap is disabled
130302 1:51:12 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130302 1:51:12 InnoDB: Compressed tables use zlib 1.2.3
130302 1:51:12 InnoDB: Initializing buffer pool, size = 16.0M
130302 1:51:12 InnoDB: Completed initialization of buffer pool
130302 1:51:12 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130302 1:51:12 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130302 1:51:13 InnoDB: Waiting for the background threads to start
130302 1:51:14 InnoDB: 1.1.8 started; log sequence number 1600324627
130302 1:51:14 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130302 1:51:14 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130302 1:51:14 [Note] Server socket created on IP: '0.0.0.0'.
130302 1:56:01 [Note] Plugin 'FEDERATED' is disabled.
130302 1:56:01 InnoDB: The InnoDB memory heap is disabled
130302 1:56:01 InnoDB: Mutexes and rw_locks use Windows interlocked functions
130302 1:56:01 InnoDB: Compressed tables use zlib 1.2.3
130302 1:56:01 InnoDB: Initializing buffer pool, size = 16.0M
130302 1:56:01 InnoDB: Completed initialization of buffer pool
130302 1:56:01 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130302 1:56:01 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130302 1:56:02 InnoDB: Waiting for the background threads to start
130302 1:56:03 InnoDB: 1.1.8 started; log sequence number 1600324627
130302 1:56:03 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130302 1:56:03 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130302 1:56:03 [Note] Server socket created on IP: '0.0.0.0'.
That is just a part of the log, the full one is a bit too big.
那只是日志的一部分,完整的有点太大了。
Help?
帮助?
采纳答案by rinuthomaz
Quit your skype and try, if skype is opne
退出你的 Skype 并尝试,如果 Skype 是开放的
or
或者
Go to your xampp/wamp installed, search for httpd.conf. Open that file using textpad/notepad, search for Listen or 80 , update listen port to 8081 and save the file. Restart xampp/wamp, start the servers.
转到安装的 xampp/wamp,搜索 httpd.conf。使用 textpad/notepad 打开该文件,搜索 Listen 或 80 ,将监听端口更新为 8081 并保存文件。重启 xampp/wamp,启动服务器。
or
follow below steps in skype
或
按照Skype中的以下步骤
回答by Zakir Ibrahim
In my case, I did two things:
就我而言,我做了两件事:
- moved
xampp/mysql/backup
files intoxampp/mysql/data
- RUN XAMPP as Administrator
- 将
xampp/mysql/backup
文件移动到xampp/mysql/data
- 以管理员身份运行 XAMPP
It worked for me :)
它对我有用:)
回答by Mohan Babu
This worked for me,
这对我有用,
- quit the XAMPP
- cut the All files in C:\xampp\mysql\backup
- paste and replace files in C:\xampp\mysql\data
- run as administrator the XAMPP
- 退出 XAMPP
- 剪切C:\xampp\mysql\backup 中的所有文件
- 粘贴并替换C:\xampp\mysql\data 中的文件
- 以管理员身份运行 XAMPP
回答by Gabriel Magalh?es
You must:
你必须:
- Close the xampp
- Go to the folder where you installed it, if in (c:) may be something like C:\xampp\ , access folder C:\xampp\mysql\data
- Delete the file ibdata1
- Starts XAMPP again.
- 关闭 xampp
- 转到您安装它的文件夹,如果 (c:) 中的内容可能类似于 C:\xampp\ ,请访问文件夹C:\xampp\mysql\data
- 删除文件ibdata1
- 再次启动 XAMPP。
回答by tom030888
There may be MySQL server installed previously in your computer try to uninstall that and start MySQL at the XAMPP This solved mine
您的计算机中可能之前安装了 MySQL 服务器尝试卸载它并在 XAMPP 上启动 MySQL 这解决了我的问题
回答by hamid
First you need to keep copy of following somewhere in your hard disk.
首先,您需要在硬盘中的某处保留以下副本。
C:\xampp\mysql\backup
C:\xampp\mysql\data
C:\xampp\mysql\备份
C:\xampp\mysql\data
After that
在那之后
Copy every thing inside "C:\xampp\mysql\backup" and paste and replace it in
"C:\xampp\mysql\data"
复制“C:\xampp\mysql\backup”中的所有内容并粘贴并替换
“C:\xampp\mysql\data”
Now your mysql will work in phpmyadmin but your tables will show "Table not found in engine"
现在您的 mysql 将在 phpmyadmin 中工作,但您的表将显示“在引擎中找不到表”
For this you will have to go to the copy of "backup and data folders" which have created in your hard disk and there in the data folder copy "ibdata1" file and past and replace in the "C:\xampp\mysql\data".
为此,您必须转到在硬盘中创建的“备份和数据文件夹”的副本,然后在数据文件夹中复制“ibdata1”文件,然后将其替换为“C:\xampp\mysql\data” ”。
Now your tables data will be available.
现在您的表数据将可用。
回答by Srinivasulu Rao
The best solution for this problem is just open your mysql configuration directive file my.inipresent inside the folder C:\xampp\mysql\binand change the information related to the ports, usually some programs occupy the port no. 3306 as a result of that it stops working, Now you follow two steps to make it working.
解决这个问题最好的办法就是打开你的mysql配置指令文件my.ini存在于文件夹C:\xampp\mysql\bin中,修改端口相关信息,通常是一些程序占用了端口号。3306 由于它停止工作,现在您按照两个步骤使其工作。
enter code here
Step-1. Search for ['client'], you can see some thing like this
[client]
# password = your_password
port = 3306
socket = "C:/xampp/mysql/mysql.sock"
Now in the port section remove 3306 and add port = 3306 > 3307 as shown below.
[client]
# password = your_password
port = 3306 > 3307
socket = "C:/xampp/mysql/mysql.sock"
Step -2. Similarly Search for ['mysqld'], you can see something like this
[mysqld]
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
Now here change the port number 3306 to 3307 and add a line "innodb_force_recovery = 1" exactly as shown below.
[mysqld]
port= 3307
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "C:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
innodb_force_recovery = 1
Thats it, restart you mysql service, it will work for sure.
就是这样,重启你的 mysql 服务,它肯定会工作。
回答by mhmoudsabry
if you inistalled mysql Independently you can stop mysql service if running no one of these answers are worked for me this work for me
如果你独立安装了 mysql 你可以停止 mysql 服务,如果运行这些答案中没有一个对我有用,这对我有用
回答by The SuperKat
Well first thing ,, I know its late so I dont know if anyone will upvote it but oh well its okay,, secondly, uninstalling xampp might not do you any good because the process using the port 3306 (Mysql's default port) will still be running somewhere on your system. might be skype, but might not be skype.
嗯,第一件事,我知道它迟到了,所以我不知道是否有人会赞成它,但好吧,好吧,其次,卸载 xampp 可能对您没有任何好处,因为使用端口 3306(Mysql 的默认端口)的进程仍将是在系统上的某个地方运行。可能是Skype,但可能不是Skype。
so the best way would be to find out which process is using port 3306, and then terminate the process.
所以最好的方法是找出哪个进程正在使用端口 3306,然后终止该进程。
so to find out which process is using port 3306, open command prompt, and type
所以要找出哪个进程正在使用端口 3306,打开命令提示符,然后键入
netstat -n -o -a
you will get a screen like this.
你会得到一个这样的屏幕 。
Then look for the address with port number 3306 and find out the PID corresponding to that.
然后查找端口号为 3306 的地址,并找出与之对应的 PID。
Then simply open a command prompt as administrator and type
然后只需以管理员身份打开命令提示符并键入
taskkill /F /PID 1234
replace 1234 with your respective PID. Then you can try starting mysql and it will work.
将 1234 替换为您各自的 PID。然后你可以尝试启动mysql,它会工作。
And now if you are lazy to do this step all over again when restarting the computer,,,
而现在如果你懒得在重启电脑的时候从头再来一遍这一步,,,
you can simply use the following batch script to terminate the process automatically and enjoy :)
您可以简单地使用以下批处理脚本自动终止该过程并享受:)
@echo off
setlocal enableextensions
set "port=3306"
for /f "tokens=1,4,5" %%a in (
'netstat -aon ^| findstr /r /c:"[TU][CD]P[^[]*\[::\]:%port%"'
) do if "%%a"=="UDP" (taskkill /F /PID %%b) else (taskkill /f /PID %%c)
endlocal
pause
save it as anything.bat and run it everytime you want to use mysql. :)
将其另存为anything.bat 并在每次要使用mysql 时运行它。:)
回答by from Iran
the true way is RECONFIGUREyour app.with setup of MYSQL.you can open your setup again and change port from 3306 to 3307.
真正的方法是重新配置您的应用程序。设置MYSQL。您可以再次打开您的设置并将端口从 3306 更改为 3307。