Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Import a database
This guide explains how to import a MySQL/MariaDB database on a Infomaniak Web Hosting.
Import a database
To import a Infomaniak database:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on Databases in the left sidebar.
- Click on the button/menu “More actions” for more options.
- Choose Import a database:
- Follow the wizard to the end.
You will then have the choice…
- … to send your database directly (
sql
,gz
,bz2
,zip
, max 300 Mo) from your computer - … to select the file to import from your hosting after uploading it to the server via FTP
… and also as an option:
- import the data into a new database (creation)
- import into an existing database (replacement/overwrite)
Alternative method (SSH - for advanced users)
Prerequisites
- Have the
.sql
file of the database to import. - Have created a new blank database.
- Have a user who has all rights on the database.
- Have a FTP + SSH account.
To import via SSH:
- Send the database to import via FTP to your hosting.
- Open an SSH terminal/console,
- 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:
ssh ftp-user@adresse-du-serveur‍
- Replace
ftp-user
with the username of the FTP + SSH account (e.g.,abcd_user
) - replace
adresse-du-serveur
with the web server address of your hosting
- Replace
- Enter the password for the FTP + SSH account.
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 (e.g.,abcd_user
) - replace
db-name
with the name of the database (e.g.,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
)
- replace
- Wait during the import (this may take several minutes depending on the size).
Link to this FAQ: