Sometimes you may need to export a database from or import a database into your web host. Here’s how you can do both using the phpMyAdmin web application.
Exporting a Database via cPanel:
- Log in to your hosting account's cPanel or similar interface.
- Click on the phpMyAdmin icon.
- Select the database you want to export from the list on the left.
- Go to the Export tab.
- Choose the Quick export method to export the entire database, or select Custom to pick specific tables.
- Set the format to SQL, click Go, and then save the file to your local drive.
You now have a SQL dump of your database for future import.
Importing Data into a Database via cPanel:
- Create a SQL file by exporting data as described above or obtain it from another source.
- If the SQL file exceeds 2MB and is not compressed, compress it into a zip file.
- If you need to create a new database or remove existing tables, refer to relevant instructions on how to set up or clean up a database.
- Log in to your hosting account's cPanel (or similar interface).
- Click on the phpMyAdmin icon and go to the Import tab.
- Click on the Choose File button to select your compressed SQL file.
- Ensure the format is set to SQL, then click Go.
Your data will be imported into the database.