How to Copy a MySQL Database to a Website
MySQL is relational database management software that can support multiple databases and users. First released in 1995, the software is among the most popular database systems and runs on a wide range of Unix, Linux, and Windows platforms. MySQL developers often have two versions of a database: one for testing purposes and one for the production environment. Copying the test database to the production server is a simple process utilizing the phpMyAdmin utility.
Instructions
-
-
1
Open phpMyAdmin on your local machine. The utility is generally located at http://localhost/phpmyadmin/.
-
2
Export your local database. Click the name of the MySQL database you want to copy to your website in the left-hand column of the main phpMyAdmin screen. On the right-hand side of the following screen, click the tab labeled "Export." Leave all of the default options on the export screen the same, except for the compression option near the very bottom. Select the button labeled "gzipped." Click "Go" to export the local database to a .gz file. Save the file to your computer.
-
-
3
Close phpMyAdmin on your local machine.
-
4
Open phpMyAdmin on your website server. The utility may be located in the /phpmyadmin folder of your website. Access it through your server's control panel if it is not.
-
5
Create a new, empty database. Under the "Create new database" field, enter a database name and click the "Create" button. (Note: Some managed web servers may not allow you to create new databases in phpMyAdmin. If this is the case, create a new database using the utility provided by your hosting company, then return to phpMyAdmin and go on to the following step.)
-
6
Import the database to your website. Click the name of the database you created in the previous step. Next, click the "Import" tab on the right-hand side of the phpMyAdmin screen. Click the "Browse" button near the top of the following screen and locate the .gz file you saved to your computer in Step 2. Click the "Go" button at the bottom of the screen to import the database. Your local database has been copied to your website successfully.
-
1