MySQL频繁崩溃求助:Windows10下MySQL5.7.17报错排查
Let’s walk through the solutions tailored to the errors you’re seeing—these are common issues with older MySQL versions on Windows, and we can resolve them step by step:
Key Error Breakdown
First, let’s decode the critical errors to understand what’s happening:
- OS Error 23: Typically relates to file access issues (missing files, permission restrictions)
- OS Error 123: Windows’ "invalid filename/path" error, which ties directly to the InnoDB table file (
sales_entry_header.ibd) mentioned in your log - The "Windows aio" failure points to compatibility bugs with MySQL’s native asynchronous I/O implementation on Windows 10
Step-by-Step Solutions
1. Fix Invalid Database/Table Paths
The error flags the table path .\pink_square_wov\sales_entry_header.ibd. Windows is strict about path characters, so:
- Check if the database name (
pink_square_wov) or table name has special characters (spaces, non-English letters, symbols like&or#). These can break InnoDB’s file handling. - Move the database folder to a simple, ASCII-only path (e.g.,
C:\MySQL\Data\pink_square_wovinstead of a path with spaces or non-Latin characters). Stop the MySQL service before moving files, then update thedatadirsetting inmy.iniif needed.
2. Disable InnoDB Native AIO
MySQL 5.7’s native Windows AIO has known bugs in older releases. Disabling it forces InnoDB to use a more stable fallback I/O method:
- Open your MySQL configuration file (
my.ini—usually located inC:\ProgramData\MySQL\MySQL Server 5.7) - Add or modify this line under the
[mysqld]section:innodb_use_native_aio = 0 - Save the file and restart the MySQL service. This should eliminate the "Windows aio" error immediately.
3. Verify File Permissions
MySQL needs full access to its data directory to read/write table files properly:
- Right-click your MySQL data folder → Properties → Security tab
- Click Edit and ensure the account running MySQL (usually
Local Systemor a dedicated service account) has Full Control permissions - Apply the changes and restart the service to ensure permissions take effect.
4. Repair Corrupted InnoDB Tables
Crashes can leave tables in a corrupted state. Here’s how to fix them:
- Stop the MySQL service
- Add this line to
my.iniunder[mysqld]to force recovery (start with level 1, which is non-destructive):innodb_force_recovery = 1 - Start MySQL and run this SQL command to repair the problematic table:
REPAIR TABLE pink_square_wov.sales_entry_header; - Once repaired, remove the
innodb_force_recoveryline frommy.iniand restart MySQL normally.
5. Upgrade MySQL (Recommended)
MySQL 5.7.17 is quite outdated (released in 2017). Later 5.7.x updates (like 5.7.44) or MySQL 8.0 fix dozens of Windows-specific stability bugs, including InnoDB AIO issues. Upgrading is the most long-term solution to prevent future crashes.
内容的提问来源于stack exchange,提问作者Sariful

