How can I upload my MySQL database?


There are a number of ways to upload your MySQL database to your account.

Using phpMyAdmin

You can use phpMyAdmin to upload your database by using ‘Import’ to upload a .sql file, or by pasting the SQL script into a query window and executing it.

To get into phpMyAdmin:

  1. Log into your eXtend Control Panel
  2. Click on ‘MySQL Databases’
  3. Click ‘Manage’ on one of your databases
  4. You are now in phpMyAdmin

To use ‘Import’:

  1. Click ‘Import’
  2. Select the file you wish to upload
  3. Select the options you need for this database
  4. Click ‘Go’
  5. The database will be imported

Please note: ‘Import’ can only be used on databases that are smaller than 16MB.

To paste your SQL script in:

  1. Select the database you wish to import into
  2. Click the SQL tab
  3. Paste your SQL script into the text area
  4. Click ‘Go’
  5. Your database, through the SQL script, will be imported

If your SQL script contains a large amount of data, you may be able to paste it in sections to get all the content in.

Using eXtend Control Panel Database Restore

You can restore existing backups through the eXtend Control Panel MySQL Database page.

To restore a backup:

  1. Log into your eXtend Control Panel
  2. Click on ‘MySQL Databases’
  3. Click ‘Restore Backup’
  4. Select the database you wish to restore from the drop-down
  5. Select the SQL file you wish to upload
  6. Click ‘Restore’
  7. The database will be imported

Using MySQL Workbench

MySQL offers the MySQL Workbench, a piece of free software that allows you to manage, backup, and restore MySQL databases. The software can restore large databases, and also comes packaged with the MySQL Query Browser.

To download and find out more about MySQL Workbench, please visit the MySQL site: http://dev.mysql.com/downloads/workbench/

Using MySQL Command Line Client in SSH

If you have SSH access to your account, you can upload your MySQL backup to your home directory, and then execute the MySQL client to load a MySQL dump file.

To get the MySQL dump file:

  1. Log into your account using SSH
  2. Enter in this line:

Mysqldump --opt -Q dbname

Where the dbname is your database’s name

  1. Upload the SQL dump file into your home directory

To load your MySQL dump using MySQL:

  1. Enter this line:

mysql -h mysqlhost -u mysqlusername -p databasename < dumpfile.sql

or

cat dumpfile | mysql -h mysqlhost -u mysqlusername -p databasename

Where mysqlhost is the name of the server, mysqlusername is your MySQL user name, datbasename is your database’s name, and dumpfile.sql is the file created by mysqldump.



Article ID: 7
Created On: Thu, Feb 26, 2015 at 4:47 PM
Last Updated On: Wed, Aug 18, 2021 at 11:08 AM

Online URL: https://www.heartinternet.uk/support/article/how-can-i-upload-my-mysql-database.html