Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Import a large database (legacy hosting)
Database importation is usually done via phpMyAdmin.
The method below is a technical alternative for databases that are too large to be processed via the web interface.
STEP 1: Database configuration
- Log in to your Infomaniak administration console.
- Go to the menu: Tools β Databases.
- Add a new database (or empty the existing database if the goal is to restore it).
- Under List of existing users, make sure to create or assign a MySQL user with all rights on the database in question.
STEP 2: Dump file (SQL) deposit
- Rename your dump file to match exactly the name of the target database followed by the extension
.sql(example: if your database is nameddomainexyz, the file must bedomainexyz.sql). - Log in to your FTP space with the administrator account (type
sys_xxx). - Deposit the file in the root directory
/data.
STEP 3: Configuration file
- In the
/datadirectory, create a file named.my.cnf(make sure to include the dot at the beginning of the name). - Important: The file must be encoded in ASCII (ANSI) and not in UTF-8.
- This file must contain the following 5 lines (with a line break after each entry):
# .my.cnf [client] host=mysql_server_address user=mysql_username password=mysql_password You will find the server address (host) in your administration console β Databases. - Modify the permissions (CHMOD) of the file
.my.cnfto0600(read/write for the owner only).
STEP 4: Importation and verification
- The automated system regularly scans the
/datadirectory. The import will start automatically a few minutes after the detection of valid files. - Once the processing is complete:
- A log file named in the form
database_name-YYYYMMDDHHMMSS.logis generated. It contains the execution report and any errors. - If the operation is successful, the source file is automatically renamed to
nom_de_la_base.old.
- A log file named in the form
Important notes and troubleshooting
- File format: The dump must be decompressed (raw
.sqlfile). Do not rename a.zipor.gzarchive, extract it first. - SQL syntax: The file must not contain the instructions
CREATE DATABASE,CONNECTorUSE, otherwise it will fail. - Table deletion: The system does not empty the database before import. If necessary, ensure that your dump contains the instructions
DROP TABLEor manually delete the existing tables via the console before import. - Source command: The SQL command
sourceis not supported as direct access to the SQL server's file system is restricted. - Upload tip: To prevent the system from attempting to process a file during transfer, upload your file with a temporary extension (e.g.
fichier.upload), then rename it to.sqlonce the transfer is complete. - Partial errors: If a query fails, the script continues importing the following lines. Always check the generated
.logfile.
You can also use the third-party script BigDump, designed to import large SQL files in sequences.
Link to this FAQ: