Frequently asked questions

Back
How do I backup my MySQL database?

Below, we describe three methods for backing up/downloading your MySQL database:

  1. The control panel at www.domainnameshop.com
  2. MySQL WorkBench (simple GUI, use it on your own PC)
  3. mysqldump (for advanced users, use it on our login server)

What about phpMyAdmin? We recommend against using phpMyAdmin. Just don't use that software, please.


The control panel at www.domainnameshop.com

Note! If your database is huge, downloading it from the control panel may be impossible. If so, there will be a warning icon () with info about that, and you must use one of the other methods.

  1. Login as usual in the controlpanel at www.domainnameshop.com/login.
  2. Select the domain from "My domains".
  3. Select the "Webhotel" tab.
  4. Select "View/change" on the MySQL line.
  5. Click the icon with the diskette (Export database to file) rightmost on the line with the relevant database.
  6. You will now receive an SQL file containing the database, as a series of SQL commands.
  7. You may restore the database by running the SQL file as an SQL script.

MySQL WorkBench

The program MySQL Workbench, available for Windows, Mac and Linux, is an easy-to-use program for administering and backing up a MySQL database. Follow these steps to backup your database with MySQL Workbench. If you already have established a connection profile, skip to point 6 about exporting.

  1. Check that you have a recent version installed, e.g. version 6.1 or newer.
  2. Note! Version 6.3.6 has a serious bug and cannot be used. 6.3.4 og 6.3.5 ought to work.
  3. You will see this error message at the bottom of the window if you have an outdated version.
  4. Create a new connection profile by clicking on the plus sign next to "MySQL Connections".
  5. Enter the usual login information for MySQL.
  6. When the connection profile is created, click on it to connect.
  7. Note: connecting MariaDB databases may result in a warning about MySQL version 10.0.xx. This is not a problem, click "Continue Anyway".
  8. Enter the program menu, select "Server", and then "Data Export".
  9. Select your database schema for export, and unselect any tables you don't want to export on the right hand side.
  10. Select whether you want one backup file per table ("Export to Dump Project Folder"), or you want the entire database dumped to one file ("Export to Self-Contained File").
  11. If you want your backup to include stored procedures and functions, check the mark for that also.
  12. Click on "Start Export".
  13. When you want to restore from a backup, select "Server" -> "Data Import" in the program menu.

Error message about MySQL version 10.0.x

MySQL WorkBench is an Oracle product, and will therefore warn about the version numbers used by MariaDB. The error message starts with a text similar to this: "Incompatible/nonstandard server version or connection protocol detected (10.0.13)" Select "Continue Anyway" to continue connecting.


The mysqldump command

Using the Unix shell on our login server, you may backup your databse with the mysqldump. This creates a set of valid SQL statements that can be used for restoring your database later.

In the interest of space and resource usage, we recommend that you download such backups to your own PC and remove them from your webhotel afterwards.

Examples for mysqldump

Note: you will be prompted for your MySQL password, so be sure to keep it handy!

1. Compressed backup

In this example, we compress the SQL data with gzip; it therefore must be unzipped with gunzip or other gzip compatible software.

mysqldump DATABASE NAME -uUSERNAME -hDATABASE NAME.mysql.domeneshop.no -p | gzip > filename.sql.gz

Substitute any filename you like for filename.sql.gz.

You may also use other software for compressing your data.

2. Uncompresed backup

If you do not wish to compress the file, drop gzip and use this command instead:

mysqldump DATABASE NAME -uUSERNAME -hDATABASE NAME.mysql.domeneshop.no -p > filename.sql

See also:

Keyword:  

Index

© 2017 Domeneshop AS · About us · Terms & Conditions · About cookies