Search code examples
mysqlmysql-workbench

How to copy the whole database to another server database?


I am currently working on a Windows application with a MySQL backend. Now I want to copy the old database structure and data to a new database server.

How can I solve this problem using MySQL workbench?

Thank you!


Solution

    1. Open MySQL Workbench
    2. Create the old server's connection (if you haven't it)
    3. Create the new server's connection (if you haven't it)
    4. Go to Server Administration and click Manage Import / Export
    5. Select old server
    6. Select all schemas in Export to Disk tab
    7. In options select Export to Self-Contained File, wait until it finished
    8. Back to Server Administration and click Manage Import / Export
    9. Select new server
    10. Switch to "Import from Disk"
    11. Click "import from Self-contained File

    This is the way with only MySQL Workbech, some times you haven't it installed in new server, like in development to production scenario, in this way you should execute the mysqlimport utility.