问题
This problem came from nowhere.
My xampp mysql service is not started. This is what it shows in Xampp log.
8:20:27 AM [mysql] Attempting to start MySQL app...
8:20:27 AM [mysql] Executing ""c:\xampp\mysql\bin\mysqld.exe" --defaults-file="c:\xampp\mysql\bin\my.ini" --standalone"
8:20:28 AM [mysql] Return code: 0
8:20:28 AM [mysql] Status change detected: running
8:20:29 AM [mysql] Status change detected: stopped
8:20:29 AM [mysql] Error: MySQL shutdown unexpectedly.
8:20:29 AM [mysql] This may be due to a blocked port, missing dependencies,
8:20:29 AM [mysql] improper privileges, a crash, or a shutdown by another method.
8:20:29 AM [mysql] Press the Logs button to view error logs and check
8:20:29 AM [mysql] the Windows Event Viewer for more clues
8:20:29 AM [mysql] If you need more help, copy and post this
8:20:29 AM [mysql] entire log window on the forums
and there is the log file
151206 8:24:31 [Note] InnoDB: Using mutexes to ref count buffer pool pages
151206 8:24:31 [Note] InnoDB: The InnoDB memory heap is disabled
151206 8:24:31 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
151206 8:24:31 [Note] InnoDB: Memory barrier is not used
151206 8:24:31 [Note] InnoDB: Compressed tables use zlib 1.2.3
151206 8:24:31 [Note] InnoDB: Not using CPU crc32 instructions
151206 8:24:31 [Note] InnoDB: Initializing buffer pool, size = 16.0M
151206 8:24:31 [Note] InnoDB: Completed initialization of buffer pool
151206 8:24:31 [Note] InnoDB: Highest supported file format is Barracuda.
151206 8:24:31 [Note] InnoDB: 128 rollback segment(s) are active.
151206 8:24:31 [Note] InnoDB: Waiting for purge to start
151206 8:24:31 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.22-72.0 started; log sequence number 1602572
151206 8:24:31 [Note] Server socket created on IP: '127.0.0.1'.
回答1:
Mostly its due to blocked ports
. By Default MySql
run on port 3306
.
Check which application is using port
3306
In Xampp > Click NetStat
it will show you all application with there running ports.
Once you find which application is running on port 3306
. Kill(close) that application and try starting MySql
now it should now work fine.
If you need the other application(who was using port 3306
) make sure Mysql
start first so the other application find some other port to start.
If this method doesn't work simply change the port
for MySql
To change MySql port
edit php.ini
on line 1262
(yours might be different) and change MySql port
from 3306
to any number between 0 to 65536
and make sure these ports are not used by any other application
If still not working re installation of xampp
might help fix the problem
来源:https://stackoverflow.com/questions/34114734/xampp-and-mysql-not-started