I. Reminder: The following operations will delete the database. Please back up the database files on your own in advance.
2. Three files are required. The file names and content of the three files are as follows:
File 1: Mysql_Drop_DataBase.txt. The content is as follows:
Drop database yourdatabase;
File 2: Mysql_Create_DataBase.txt. The content is as follows:
Create database yourdatabase;
File 3: automatically compress the ibdata1 file capacity. bat with the following content:
Rem deletes a database
Mysql-u username -- password = password <"Mysql_Drop_DataBase.txt"
Rem stops mysql Service
Net stop mysql
Rem deletes ibdata1, iblogfile0, and ib_logfile1 files. Replace the following file path.
Del "G: \ MySQL Datafiles \ ibdata1"
Del "C: \ ProgramData \ MySQL Server 5.5 \ data \ ib_logfile0"
Del "C: \ ProgramData \ MySQL Server 5.5 \ data \ ib_logfile1"
Rem starts mysql Service
Net start mysql
Rem create database
Mysql-u username -- password = username <"Mysql_Create_DataBase.txt"
3. Click "automatically compress ibdata1 file capacity. bat" to start running.