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 Web Hosting.
Importing a Database
To export an Infomaniak database:
- Log in to the Infomaniak Manager (manager.infomaniak.com) from a web browser like Brave or Firefox
- Click on the icon in the top right corner of the interface (or navigate through the left side menu, for example)
- Choose Hosting (in Web & Domain)
- Click directly on the name of the relevant object in the displayed table
- Click on Databases in the left side menu
- Click on the Import button
Then you have the option to:
- Directly upload your database (sql, gz, bz2, zip, max 300 MB) from your computer
- Select the file to import from your hosting after depositing it on the server via FTP
and also choose:
- Import data to a new database (creation)
- Import to an existing database (replace/overwrite)
Alternative Method (for advanced users)
Prerequisites
- Have the *.sql file of the database to be imported
- Have created a new empty database
- Have a user with all rights to the database
- Have an FTP + SSH account
Importing via SSH
- Upload the database to be imported via FTP to your hosting
- Open the PuTTY application (download and install on PC) or Terminal (installed by default in macOS)
- Enter and adapt the following command: ssh ftp-user@server-address
- Replace ftp-user with the FTP + SSH account username (e.g., abcd_user)
- Replace server-address with the web server address of your hosting
- 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 user name (e.g., abcd_user)
- Replace db-name with the database name (e.g., abcd_sample)
- Replace db-host with the MySQL server of your hosting
- Replace path with the path where you uploaded 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)
- Wait for the import to complete (this may take several minutes depending on its size)
Link to this FAQ: