With Website 2 Backup the backup of each of your MySQL tables is done in one *.sql file. We will see a solution to merge several *.sql files with Windows, to import them faster with phpMyAdmin.
You can have several tables to import in a MySQL database with phpMyAdmin. With the phpMyAdmin import functionality you can import your tables using *.sql files. It is fast if you have few sql tables but if you have tens it will be time consuming. The solution is to merge all your *.sql files in one file. We will explain here how to merge all your *.sql files in one using Windows commands.
In Windows Start > Accessories > Execute, a windows appear Type cmd and hit enter a DOS windows appear You can see at the left of the command line where you are in your directories. You can use the dir command to see files and subdirectories of your actual directory. Using the commands cd.. and cd directory_name go to the directory where are your *.sql files to merge. you can use the command help cd to have more informations about it.
I have found a faster way to open the Command Prompt in the right directory with the contest menu.
- In your files explorer go to the directory where are your files to merge.
- Hold the SHIFT key while you right-click the folder and click on “Open Command Prompt Here”
- In the Command Prompt enter : copy *.sql merged.sql hit Enter to copy all data into merged.sql
- Close the Command Prompt window.
- Open merged.sql in your favorite sql editor and go to the bottom of the content to check if Windows has added an unwanted character, remove it if needed.
All your *.sql are merged into merged.sql you can now import them with few clicks in phpMyAdmin.
This post has been updated the 2012-03-30