Knowledge base

1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!

Import a database

This guide explains how to import a MySQL/MariaDB database on an Infomaniak Web Hosting.

 

Import a database

To import a database on Infomaniak:

  1. Click here to access the management of your product on the Infomaniak Manager (need help?).
  2. Click directly on the name assigned to the product in question.
  3. Click on Databases in the left sidebar menu.
  4. Click on the “More actions” button/menu for more choices.
  5. Choose Import a database:
  6. Follow the assistant to the end.

 

You will then have the choice…

  • … to send your database directly (sql, gz, bz2, zip, 300 Mo max) from your computer
  • … to select the file to import from your hosting after uploading it to the server via FTP
  • … to choose a backup from those that are done automatically

… then also choose:

  • import data into a new database (creation)
  • import into an existing database (replacement/overwrite)

 

Warning: a MySQL/MariaDB import following an export requires an action on your part if you use TRIGGERS/VIEWS: refer to this other guide!

 

Alternative method (SSH - for advanced users)

Prerequisites

To import via SSH:

  1. Send the database to import via FTP to your hosting.
  2. Open an SSH terminal/console,
  3. From a Terminal type application (command line interface, CLI / Command Line Interface) on your device, for example the application PuTTY (to download and install on Windows) or Terminal (installed by default on macOS), run and adapt the following command:
  4. ssh ftp-user@adresse-du-serveur‍
  5. Enter the FTP + SSH account password.
  6. Enter and adapt the following command:

    mysql --verbose -u db-user -p db-name -h db-host < path‍
    • replace db-user with the database username (for example abcd_user)
    • replace db-name with the database name (for example abcd_sample)
    • replace db-host with the MySQL server of your hosting
    • replace path with the path where you sent the database in step 1 of this procedure (if you have a single website stored in the default location, the path would be for example ~/web/test.sql)
  7. Wait during the import (this can take several minutes depending on the size).

Has this FAQ been helpful?