Help Docs Control Panel Guides Cloud Sites Guide Database Management in Cloud Sites MariaDB / MySQL Cloud Sites Databases Import a Large MariaDB Database into Cloud Sites

Import a Large MariaDB Database into Cloud Sites

Upload databases that are 50MB or less into Cloud Sites using phpMyAdmin or myLittleAdmin database managers.

Upload databases that are 50MB or less into Cloud Sites using phpMyAdmin or myLittleAdmin database managers. However, if you need to import a database that exceeds 50MB, you will need to use a script and schedule a cron job to upload the database. See our article Creating Cron Jobs in Cloud Sites for information on creating a cron job.

Below is a sample script that you can set up to upload a large database into Cloud Sites.

The code below is only an example, your specific site may require a different configuration. We recommend speaking with your developer before implementing any scripts. If you do copy/paste this code, it must be saved as a .config file only. As outlined in the Liquid Web Terms of Service, we are unable to help troubleshoot code issues and the example provided below is only for your own troubleshooting purposes.
#!/bin/sh
mysql -h DB_HOST -u DB_USER -p'DB_PASSWORD' DB_NAME < /path/to/file/db_import.sql

Replace the placeholders with your actual information, definitions of the information needed are below:

  • DB_HOST: The name of the database host.
  • DB_USER: The name of the database user.
  • DB_PASSWORD: The password of the target database.
  • DB_NAME: The name of the database you are creating/restoring.

When creating the script, it needs to be saved and created as a perl/bash cron job. Once you build the script, you can upload it into your Cloud Sites cron job.

Warning:

Do not store script files in your webroot directory, this can create a security issue. Use a non-public viewable directory to store any scripts.
Was this article helpful?