Knowledge base

Welcome to Infomaniak Network's support centre, you will find the answers to the most frequently asked questions below.

The most current way of importing a database on our servers is to use phpMyAdmin as explained in this guide. The following import method is a little more complex, but it only concerns in theory databases that are too heavy to be imported directly via phpMyAdmin.

Here is our method for automatic import of MySQL dumps on our servers. Proceed in the following order, respecting scrupulously the instructions below. You will find another alternative at the end of the text.



STEP 1 - Preparing MySQL

In your administration console under Tools > Databases > Add > "List of existing databases" add a database (or delete and re-create the existing one if you want to restore it), then under «List of existing users» create a MySQL account with enough rights to administer the MySQL databases on your site, and assign the rights for READ, WRITE, ADMIN.


STEP 2 - Configuration file

Connect via FTP to your site using the FTP administrator account (sys_xxx).

Insert a .my.cnf file at the root in the /data directory. If the . (dot) is missing at the beginning of the file name the my.cnf file will automatically be renamed in .my.cnf next time the robot goes through. If you use Windows, first download the my.cnf file and then rename it as .my.cnf once on the server. This file must be in ASCII encoding, not in UTF8 or other.

The file must have 5 lines:
  1. the # .my.cnf instruction (do not modify)
  2. the [client] instruction (do not modify)
  3. the MySQL server address   (you will find it in the console, under databases, in red at the bottom of the page)
  4. the MySQL username (use the one set in the console, under databases)
  5. the MySQL user password (use the one set in the console, under databases)
with line feeds at the end of each line. All of which gives:
# .my.cnf
[client]
host=mysql.domain.com
user=toto
password=1234
Using your FTP tool, put the .my.cnf file in CHMOD 0600, i.e. read/write for the owner only.


STEP 3 - sending of your .sql backup

Insert your MySQL dump files via FTP in the same /data directory at the root of the FTP, naming them name_of_the_target_mysql_database.sql (e.g.: domaincom.sql). You can import dumps from several databases simultaneously, one file per database.
  • Dumps should not contain CREATE DATABASE or CONNECT or USE. Otherwise the dump will not be imported properly.
  • The "source" command cannot be used on our servers because the server on which your databases are hosted isn't accessible from the file system.
  • If one of the dump lines contains an error it will continue to import the rest. Errors will be found after processing in the "name of MySQL database"-"YYYYMMDDHHMMSS".log file
  • >The dump must be unzipped. It is important not to rename the zipped file but its content.
A robot will check every 5 minutes the presence of MySQL dumps in the data directory and will import it into the required database. If the robot checks during a .sql file upload, this robot may process this file as incomplete. To avoid this you can download your file with an extension other than .sql so the robot doesn't take it in account, and then rename the file once the upload is over.


STEP 4 - end

After processing, the "MySQL database name"-"YYYYMMDDHHMMSS".log file will contain the result of the queries and any import errors. If it's empty it's because everything is OK, the dump file name_of_target_mysql_database.sql will have been renamed to name_of_the_target_mysql_database.old.


STEP 5 - in case an error occurrs

If you have any problems in following this procedure exactly, we will need to know:
  • Your domain
  • The name of the file being imported and the database it shoud be imported in
  • Your MySQL login details (user/password)
  • The contents of the logs file.
Please send all this using our form (click here) and leave all the files (the original dump file name_of_the_target_mysql_database.sql to import as well) as they currently are in place on the server.


loading...
Fermer





Alternative

You can also try using the bigdump.php script that allows you to import a database automatically; it cuts out the dump file and makes the import. You will find it at http://www.ozerov.de/bigdump.php (in English)



Link to this answer :
Hosting »  MySQL/PhpMyAdmin  »  All

Online support

Email support