[PHP3.01] How can I upload my MySQL database?

There are numerous ways to upload a MySQL database, we would strongly recommend trying methods 2 and 3

Method 1 – phpMyAdmin

You may use phpMyAdmin to load your database by using the Import link to upload a .sql file or by pasting the SQL script into a query window and executing it. For the latter method -

1. Login to phpMyAdmin with a MySQL user that has been given DBA rights to the MySQL database you wish to load.
2. Then click on the SQL tab.
3. Paste the SQL script content into the text area, and click Go.

If the SQL script contains a lot of data, you might still get away with this by pasting it bit by bit. If the data is simply too large, see the other sections.

Method 2 - Hosting cPanel v7.5 control panel restore

In the Hosting cPanel v7.5 control panel go to the MySQL Databases page.
On this page is the text "To restore a database which you've previously backed up, click here."
If you follow the link, you can upload a larger SQL file than would be possible in phpMyAdmin.

If the SQL file is very large, please consider one of the other methods below

Method 3 - MySQL Administrator

MySQL offer free software to manage, backup and restore MySQL databases.
The software can restore very large files, and also comes packaged with MySQL Query Browser, which can be used a faster alternative to phpMyAdmin
You can download the software at http://dev.mysql.com/downloads/gui-tools/5.0.html

Method 4 - MySQL command line client

This requires you to have SSH Access, which may or may not be available on your particular package.
Due to the limitations imposed by PHP, phpMyAdmin is unable to load a large MySQL dump data.

You can upload the MySQL dump file created by mysqldump --opt -Q dbname to your home directory, and then execute the MySQL client to load it.

To load your sql dump using MySQL, you can use the following command:

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

or

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

Where:

mysqlhost - The name of the server where your MySQL database is located. You can find this out from the Control Panel in the MySQL Database area.
mysqlusername - Your MySQL User name as created through the Control Panel.
databasename - This is the name of your database
dumpfile.sql - The file created by mysqldump

Was this answer helpful?

 Print this Article

Also Read

[PHP3.15] How do I edit php.ini (PHP settings) for my hosting package?

Becuase of the way in which we run PHP, you are able to customise its behaviour with php.ini...

[PHP3.17] Using PHP5 makes all my products disappear in OSCommerce

We have updated our version of php so the default used is PHP5 rather than PHP4. This can cause...

[PHP3.13] Mime magic is not enabled

To enable mime magic, add the following to your php.ini file:mime_magic.magicfile =...

[PHP3.08] Do you support Zend Optimizer?

Zend Optimizer is available for use on our servers, though optimized code is not supported by us...

[PHP3.04] What is PHP?

Self-referentially short for PHP: Hypertext Preprocessor, an open source, server-side, HTML...