Php WindowsMySQL上的XAMPP将突然启动然后停止,但APACHE工作正常

Php WindowsMySQL上的XAMPP将突然启动然后停止,但APACHE工作正常,php,mysql,apache,xampp,Php,Mysql,Apache,Xampp,好吧,我到处寻找解决方案,但没有一个奏效。昨天,我的XAMPP工作得非常好。今天,我试图启动我的MySQL服务,但它不起作用。让我更具体一点:这是XAMPP日志: Attempting to start MySQL app... 9:54:00 AM [mysql] Status change detected: running 9:54:01 AM [mysql] Status change detected: stopped 9:54:01 AM [mysql]

好吧,我到处寻找解决方案,但没有一个奏效。昨天,我的XAMPP工作得非常好。今天,我试图启动我的MySQL服务,但它不起作用。让我更具体一点:这是XAMPP日志:

Attempting to start MySQL app...
9:54:00 AM  [mysql]     Status change detected: running
9:54:01 AM  [mysql]     Status change detected: stopped
9:54:01 AM  [mysql]     Error: MySQL shutdown unexpectedly.
9:54:01 AM  [mysql]     This may be due to a blocked port, missing dependencies, 
9:54:01 AM  [mysql]     improper privileges, a crash, or a shutdown by another >method.
9:54:01 AM  [mysql]     Press the Logs button to view error logs and check
9:54:01 AM  [mysql]     the Windows Event Viewer for more clues
9:54:01 AM  [mysql]     If you need more help, copy and post this
9:54:01 AM  [mysql]     entire log window on the forum
这是错误日志:

016-03-23 09:54:00 1d04 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
160323  9:54:00 [Note] InnoDB: Using mutexes to ref count buffer pool pages
160323  9:54:00 [Note] InnoDB: The InnoDB memory heap is disabled
160323  9:54:00 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
160323  9:54:00 [Note] InnoDB: Memory barrier is not used
160323  9:54:00 [Note] InnoDB: Compressed tables use zlib 1.2.3
160323  9:54:00 [Note] InnoDB: Not using CPU crc32 instructions
160323  9:54:00 [Note] InnoDB: Initializing buffer pool, size = 16.0M
160323  9:54:00 [Note] InnoDB: Completed initialization of buffer pool
160323  9:54:00 [Note] InnoDB: Highest supported file format is Barracuda.
160323  9:54:00 [Note] InnoDB: The log sequence numbers 1665234 and 1665234 in ibdata files do not match the log sequence number 2110930 in the ib_logfiles!
160323  9:54:00 [Note] InnoDB: Database was not shutdown normally!
160323  9:54:00 [Note] InnoDB: Starting crash recovery.
160323  9:54:00 [Note] InnoDB: Reading tablespace information from the .ibd files...
160323  9:54:00 [Note] InnoDB: Restoring possible half-written data pages 
160323  9:54:00 [Note] InnoDB: from the doublewrite buffer...
160323  9:54:01 [Note] InnoDB: 128 rollback segment(s) are active.
160323  9:54:01 [Note] InnoDB: Waiting for purge to start
160323  9:54:01 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.22-72.0 started; log sequence number 2110930
160323  9:54:01 [Note] Plugin 'FEEDBACK' is disabled.
160323  9:54:01 [Note] Server socket created on IP: '::'.
Apache可以正常工作,并且正在运行。顺便说一句,我尝试过的事情:

正在删除ibdata1文件。 更改my.ini中的端口。 Skype没有运行。
停止万维网发布服务。

好的,我自己解决了。所以我查看了windows事件查看器,发现一些错误来自MySQL。我点击了最近的一个,发现了这个

mysqld.exe:表'.\mysql\db'被标记为已崩溃,上次(自动?)修复失败


我替换了所有数据库文件:db.frm,db。MYD和db.MYI(将它们复制到桌面以备不时之需)以及备份中的文件。维奥拉,它又起作用了。所有的数据都在那里,即使是我记得昨天插入的数据。

在我的例子中,这是因为我安装了MySQL Workbench,它也使用端口3306安装MySQL。 所以有两个MySQL安装,都试图使用端口3306。工作台似乎占了上风

将XAMPP MySQL更改为使用端口3308是最简单的

  • 从XAMPP控制面板:停止Apache和MySql
  • 编辑
    my.ini
    (在某些MySql安装中,这将是
    my.cnf
    ;在其他安装中,这将是
    my.ini

    它的位置取决于您安装XAMPP的位置。在我的系统上,我在
    T:\xampp\mysql\bin\my.ini
    找到了它。 (我的系统上MySQL工作台的可比文件位于``)
  • 搜索
    3306
    (或
    端口
    );替换为
    3308

    有两个地方我将行替换为:
    port=3306
    port=3308
  • 拯救
  • 从XAMPP控制面板:启动Apache和MySql