MySQL - Restore lost data in MySQL using InnoDB engine without file ibdata1

Опубликовано: 06 Октябрь 2024
на канале: Next Wallpress Inc.
35,951
84

Below are the tutorials:

1. Enable innodb_file_per_table=1 inside my.ini / my.conf
2. Install MySql Utilities Console
3. If you can't install software above, make sure you have Visual C++ Installed in your computer. If you don't have, just download it by searching at google.
4. Open Command Prompt
5. Point to your old database directory. Ex: cd c:\xampp\mysql\data\xxx
6. Type command: see video
7. Command above will create txt file contains the script to create the old table.
8. Just open your txt file in the same directory.

---------------------------------------------------------------
NEXT STEP
---------------------------------------------------------------
1. Open your mysql command inside your mysql bin folder. Ex: mysql -u root -p
2. Create new database. Ex: create database xxx;
3. Choose that database. Ex: use xxx;
4. Copy and paste script to create the old table.
5. Type:
ALTER TABLE `name_of_table` DISCARD TABLESPACE;
6. Go to your old database directory, then copy your name_of_table.ibd file manually into new database folder.
7. After that you can just type:
ALTER TABLE `name_of_table` IMPORT TABLESPACE;
8. Done
9. You can test with query:
Select * from name_of_table limit 0,10;


Thank you, www.000software.com
Subscribe us