XAMPP:即使我更改了 MySQL 端口,它也会被阻止

Posted

技术标签:

【中文标题】XAMPP:即使我更改了 MySQL 端口,它也会被阻止【英文标题】:XAMPP: MySQL port blocked even when I changed it 【发布时间】:2018-08-26 10:53:23 【问题描述】:

最初我让 XAMPP 与 MariaDB 一起运行,然后意识到我需要 mysql,因此尝试单独安装 MySQL (https://dev.mysql.com/downloads/installer/),但这变得非常混乱,所以我卸载了所有东西并重新安装了带有 MySQL 的 XAMPP (https://filehippo.com/download_xampp/)。

但是 MySQL 一直告诉我它的端口被阻塞了。我找不到阻塞端口的原因,所以我在 my.ini 文件以及 XAMPP 服务和端口设置中将其更改为 Port: 3308(最初是 Port: 3306)。但是我仍然得到一个错误,所以现在我真的很困惑为什么 MySQL 拒绝工作。

谁能解决这个问题?

MySQL 错误日志:

2018-03-17 13:07:28 1a34 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.
2018-03-17 13:07:28 6708 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.

2018-03-17 13:07:28 6708 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-03-17 13:07:28 6708 [Note] InnoDB: The InnoDB memory heap is disabled
2018-03-17 13:07:28 6708 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-03-17 13:07:28 6708 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
2018-03-17 13:07:28 6708 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-03-17 13:07:28 6708 [Note] InnoDB: Using generic crc32 instructions
2018-03-17 13:07:28 6708 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2018-03-17 13:07:28 6708 [Note] InnoDB: Completed initialization of buffer pool
2018-03-17 13:07:28 6708 [Note] InnoDB: Restoring page 0 of tablespace 0
2018-03-17 13:07:28 6708 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2018-03-17 13:07:28 6708 [ERROR] InnoDB: space header page consists of zero bytes in data file C:\xampp\mysql\data\ibdata1
2018-03-17 13:07:28 6708 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2018-03-17 13:07:28 6708 [ERROR] Plugin 'InnoDB' init function returned error.
2018-03-17 13:07:28 6708 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-03-17 13:07:28 6708 [Note] Plugin 'FEEDBACK' is disabled.
2018-03-17 13:07:28 6708 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-03-17 13:07:28 6708 [ERROR] Aborting

【问题讨论】:

MariaDB 和 MySQL 差不多.. 【参考方案1】:
InnoDB: space header page consists of zero bytes in data file C:\xampp\mysql\data\ibdata1

不是端口阻塞,而是文件的问题。

看起来磁盘已满,没有权限,或者您应该使用 chkdsk。可能文件 ibdata1 已损坏。

【讨论】:

我环顾四周,通常如果出现此问题,人们会删除 ibdata* 文件和 ib_logfile* 文件。我这样做了,它仍然没有解决。但它重新创建了 ibdata1、ib_logfile0 和 ib_logfile1。

以上是关于XAMPP:即使我更改了 MySQL 端口,它也会被阻止的主要内容,如果未能解决你的问题,请参考以下文章

在 Mac OS 中更改 XAMPP MySQL 端口

在 Mac OS 中更改 XAMPP MySQL 端口

XAMPP 中的 Apache 和 MySQL 无法启动

为 MySQL 服务器更改端口 XAMPP Windows 7

Xampp Apache 服务未启动

XAMPP MySQL无法连接:无效设置