Home >Database >Mysql Tutorial >How to delete ibdata1 in mysql

How to delete ibdata1 in mysql

藏色散人
藏色散人Original
2023-02-15 09:43:222425browse

Mysql method to delete ibdata1: 1. Find the location of "ibdata1"; 2. Execute the "net stop MySQL" command; 3. Delete "ibdata1" through "ib_logfile0 ib_logfile1 ibdata1".

How to delete ibdata1 in mysql

The operating environment of this tutorial: Windows 10 system, mysql5.5 version, Dell G3 computer.

mysql How to delete ibdata1?

Delete ibdata1:

High-risk operation, perform it with caution, because after the operation is completed, the original table of the database may become unusable!

Things to note in database optimization

1. In the database test, if one of the tables has a large amount of data, the insertion efficiency of the other table will be very low

2, ibdata1

When you enable innodb_file_per_table, tables are stored in their own table spaces, but the shared table space still stores other InnoDB internal data:

  • Data dictionary, which is the metadata of the InnoDB table

  • Change buffer

  • Double write buffer

  • Undo log

When we initialize ibdata1, it is best to set it larger. In high concurrency scenarios, ibdata1 will increase sharply and greatly affect performance.

ibdata1

The default location is

C:\ProgramData\MySQL\MySQL Server 5.5\data

Close the database and restart it

net stop MySQL

Delete

ib_logfile0
ib_logfile1
ibdata1

Restart the database

net start MySQL

Currently, no better optimization method has been found

Recommended study: "MySQL Video Tutorial"

The above is the detailed content of How to delete ibdata1 in mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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