XAMPP中Apache正常工作时,MySQL意外关闭

6
当我点击启动按钮时,我的XAMPP控制面板显示此消息。
这个警告表示MySQL意外关闭,但Apache服务器运行正常。
11:29:21 AM  [main]     Starting Check-Timer
11:29:21 AM  [main]     Control Panel Ready
11:29:28 AM  [main]     Executing "c:\xampp\mysql"
11:29:50 AM  [mysql]    Attempting to start MySQL app...
11:29:51 AM  [mysql]    Status change detected: running
11:30:00 AM  [mysql]    Status change detected: stopped
11:30:00 AM  [mysql]    Error: MySQL shutdown unexpectedly.
11:30:00 AM  [mysql]    This may be due to a blocked port, missing dependencies, 
11:30:00 AM  [mysql]    improper privileges, a crash, or a shutdown by another method.
11:30:00 AM  [mysql]    Press the Logs button to view error logs and check
11:30:00 AM  [mysql]    the Windows Event Viewer for more clues
11:30:00 AM  [mysql]    If you need more help, copy and post this
11:30:00 AM  [mysql]    entire log window on the forums

以下是 MySQL 错误日志:

2020-05-05 11:29:51 0 [Note] InnoDB: using atomic writes.
2020-05-05 11:29:51 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2020-05-05 11:29:51 0 [Note] InnoDB: Uses event mutexes
2020-05-05 11:29:51 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-05-05 11:29:51 0 [Note] InnoDB: Number of pools: 1
2020-05-05 11:29:51 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-05-05 11:29:51 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2020-05-05 11:29:51 0 [Note] InnoDB: Completed initialization of buffer pool
2020-05-05 11:29:51 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-05-05 11:29:51 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-05-05 11:29:51 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-05-05 11:29:51 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2020-05-05 11:29:51 0 [Note] InnoDB: Waiting for purge to start
2020-05-05 11:29:51 0 [Note] InnoDB: 10.4.8 started; log sequence number 113908; transaction id 9
2020-05-05 11:29:51 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2020-05-05 11:29:51 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-05-05 11:29:51 0 [Note] InnoDB: Buffer pool(s) load completed at 200505 11:29:51
2020-05-05 11:29:51 0 [Note] Server socket created on IP: '::'.

我尝试了StackOverflow上大部分的方法,但没有起作用。
有没有人能帮我找到解决办法?

3个回答

9

成功了!这个实际上是在做什么? - Salman

8

这个方法解决了我的问题。

步骤1:将 c:\xampp\mysql\data 文件夹重命名为 c:\xampp\mysql\data_old(你可以使用任何名称)。

步骤2:创建一个新的文件夹 c:\xampp\mysql/data。

步骤3:将 mysql\backup 中的内容复制到新的 mysql\data 文件夹中。

步骤4:将位于 mysql\data_old 中的所有数据库文件夹复制到 mysql\data 中(跳过 data_old 中的 mysql、performance_schema 和 phpmyadmin 文件夹)。

步骤5:最后,将 ibdata1 文件从 mysql\data_old 复制并替换到 mysql\data 文件夹中。

步骤6:从 XAMPP 控制面板启动 MySQL。

完成了。没有丢失数据库,没有更改端口,不需要以管理员身份运行,不需要强制恢复,没有杀死 mysqld 进程,也不需要从之前的版本中恢复,没有更多的错误。

如需更多信息,请查看此 博客文章


0

我遇到的主要问题是,我的一些数据库大小过大

但是ibdata1无法自动扩展。

所以我按照以下步骤进行操作,我的错误得到了解决:

  1. 前往mysql/data文件夹;

  2. 删除aria_log.00000001, aria_log_control, ib_logfile0, ib_logfile1, ibdata1, mysql.pid这些文件;

  3. 进入mysql/bin中的my.ini文件;

  4. 在此文件中,您会发现一些与缓冲区大小相关的键值,例如:key_buffer, max_allowed_packet, sort_buffer_size, net_buffer_length, read_buffer_size, read_rnd_buffer_size, myisam_sort_buffer_size, innodb_data_file_path, innodb_buffer_pool_size, innodb_log_file_size, innodb_log_buffer_size, innodb_lock_wait_timeout, max_allowed_packet

  5. 重启Apache和MySQL;

检查问题是否已解决。对我有100%的帮助。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接