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 to an Infomaniak Web Hosting.
Import a database
To import a database on Infomaniak:
- 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 “More actions” button/menu 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
, 300 Mo max) from your computer - … to select the file to import from your hosting after uploading it to the server via FTP
... or also choose:
- import data to a new database (creation)
- import to 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 an 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 (for exampleabcd_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 (for exampleabcd_user
) - replace
db-name
with the database name (for exampleabcd_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 while importing (this may take several minutes depending on the size).
Link to this FAQ: