MySQL Database Export and Import

  • Need : If you have N no. of tables with data inserted. and you want to give all tables with queries and data to anyone. You can give in single backup file (Script).

  • Required tools :

    1. MySQL Server

    2. MySQL GUI Tools 5.0

    3. MySQL Query Browser

  • Follow the following Steps :

  1. Go to Folder- MySQL GUI Tools 5.0/MySQLAdministrator and open MySQLAdministrator tool by double clicking.

  2. Exporting MySQL Database from MySQL Administrator

  3. After double clicking, following window will open –

  4. MySQL Administrator Connect to MySQL Server Instance

  5. Enter localhost, port, username, and password and click on Ok.

  6. Enter MySQL Server Instance credentials

  7. After clicking on Ok, following window will open –

  8. MySQL Administrator Server Information

  9. Now go to Backup –

  10. Click on Backup in MySQL Administrator

  11. Click on New Project -> Select database which you want to backup as below:

  12. Now Click on New Project and select Database which you want to backup

    Note – You can also select tables.

  13. Select location of backup file and give name to the backup file and click on Save as (eg.- activityBackup).

  14. Select Location eg. 'Desktop' for backup file, give name to it and Save it

  15. Click on OK and Close application.

  16. Now Click on Ok and close the Application

  17. Now you can see the Backup file is generated on Desktop :

  18. We can see the Backup file is generated on Desktop

  • Follow the following Steps :

  1. Open MySQL Query Browser

  2. Open MySQL Query Browser

  3. Go to File -> New Script Tab

  4. In MySQL Query Browser, Go to File and click New Script Tab

    New Script Tab in MySQL Query Browser

  5. Now open your Backup file with WordPad

  6. Open Database Backup file which we have saved on Desktop with WordPad

  7. Copy all content from backup file.

  8. Copy all contents from Backup File

  9. Now Paste in Script tab of Query Browser and click on Execute Button

  10. Now Paste in Script tab of Query Browser and click on Execute Button

  11. Now database will create with all table (with data)

  12. Now database will create with all table (with data)

  13. Now You can check database is created with all tables inside it.

  14. Now we can check in Schemata that database is created with all tables inside it