Home > Database > Mysql Tutorial > How to shrink/clear ibdata1 file in MySQL?

How to shrink/clear ibdata1 file in MySQL?

WBOY
Release: 2023-09-04 14:21:01
forward
848 people have browsed it

The ibdata1 file cannot be shrunk, which is a particularly troublesome feature of MySQL. You can shrink the ibdata1 file if you drop all databases, delete the files, and reload mysqldump.

We can configure MySQL so that each table (including its indexes) is stored as a separate file. Enabled by default starting with MySQL version 5.6.6.

To set up our server to use a separate file for each table, we need to change my.cnf to enable it.

如何收缩/清除 MySQL 中的 ibdata1 文件?

If your MySQL version is lower than 5.6.6, then you need to add this to the my.cnf file.

[mysqld]
   innodb_file_per_table = 1
Copy after login

The above is the detailed content of How to shrink/clear ibdata1 file in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template