How do I create or import a MySQL dump file? Print
Submit Cancel
Email this article

Close

You are here: Home > Website Support > MySQL

Creating a dump file of an existing MySQL database on the Hetzner server:

  1. Telnet or SSH to the hosting server
  2. Run the following command:
mysqldump --add-drop-table --u[db username] -p
[db password] 
-h[db-host] [db name] dumpfile.sql

Eg.

mysqldump --add-drop-table --udatabase_1 -ppassword_1 -hsql4a.your-server.co.za database1 database_dump.sql 

Replace the names between [ ] with your server/database name.

Importing a dump file to the Hetzner server to create the data structure/data:

  1. FTP your dump file to the home directory or your web hosting package
  2. Telnet or SSH to the hosting server
  3. Run the following command from the same directory:

mysql -u[dbusername] -p
[dbpassword] 
-h[dbhostname] [databasename] dumpfile.sql

Eg.

mysql -udatabase_1 -ppassword_1 -hsql4a.your-server.co.za database1 database_dump.sql 

Replace the names between [ ] with your server/database name.

Creating a dump file of less than 5MB to your Hetzner server via phpMyAdmin:

  1. Click on the PHPMyAdmin link next to the database in KonsoleH
  2. Once the PHPMyAdmin interface has loaded click on the ‘Export’ Tab at the top.
  3. If you do not have any specific requirements for the dump file you can just hit “GO” at the bottom of the page.
  4. Choose a location on your PC to save the dump file.

Importing a dump file of less than 5MB to your Hetzner server via phpMyAdmin:

  1. Select the ‘SQL’ query window from the top left hand corner within ‘phpMyAdmin’, this will open a separate pane
  2. Select ‘Import Files’
  3. Click on ‘Browse’ to find the dump file located in your local directory
  4. Click ‘Open’ to select the dump file
  5. Then click on ‘Go’ to begin the upload of the dump file to the server

You can download phpmyadmin to your local PC and manage your database there, if the limitation of 5MB is too restrictive. This requires you to have PHP, a webserver and Mysql installed locally.

Additional Resources (external links):

MySQL home page (http://www.mysql.com)
MySQL tutorials (http://www.devshed.com/c/b/MySQL)

Was this information helpful?

Yes No

Thank you for your feedback
We are delighted to find that our article resolved your query.

Thank you for your feedback
We will resolve your query as soon as possible.

Please take a few moments to comment on your unresolved query. Simply tell us what your problem is. We guarantee that we'll get back to you within two hours (during office hours) in response to your query.


  Partially resolved    Unresolved
Enter your query here:
Your name:
Your email address:
Contact number:
Customer number or domain name:
 
Preferred contact method: Email     Call me
Please enter the text in the picture below into the text box:
CAPTCHA Image:
ID Number:
 
  • Hosting for Beginners

    Step-by-step guide to hosting with Hetzner.

    VIEW NOW
  • Application Tutorials

    Use our installation guides to get up and running.

    VIEW NOW
  • Login Now

    Our award winning proprietary control panel empowers customers to manage their hosting environment.

    Take the Tour
  • Contact Us

    support@hetzner.co.za

    Phone: 0861-0861-08
    Fax: 0861 0861-09
    Contact Us