The database is running well, and suddenly it reports an error that the database file cannot be opened.
One, the problem is reported
can't open file (errno:24)
can't open the database file
Two, solution ideas
- First of all, we must first check the error log of the database. Then determine whether the table is damaged or a permission problem. It is also possible that the table cannot be accessed normally due to insufficient disk space; the limitations of the operating system should also be paid attention to; use the perror tool to view the specific error!
linux:/usr/local/mysql/bin # ./perror 24
OS error code 24: Too many open files
- Exceed the limit of the maximum number of open files! ulimit -n View that the maximum number of open files in the system is 65535, which cannot be exceeded! That must be the maximum number of open files in the database exceeds the limit!
- View the maximum number of open files limit command in MySQL: show variables like'open_files_limit';
- Found that the value is too small, change it to 2048, restart MySQL, the application is normal.
Three, processing methods
repair table ;
chown mysql 权限
清理磁盘中的垃圾数据