: How do I replace a MySQL Database? I created a database on the host server using PHPMyAdmin. I exported the database for local development and have since added data and changed the schema
I created a database on the host server using PHPMyAdmin.
I exported the database for local development and have since added data and changed the schema slightly.
How can I replace the database on the server with my local version? Some source I read say to go to that database in PHPMyAdmin and upload, but I'm not convinced that is correct.
How do I replace a MySQL Database?
More posts by @Berumen354
3 Comments
Sorted by latest first Latest Oldest Best
There is an alternative way to export and import the database if you have terminal access to the server.
Export the file via terminal
Execute the following command replacing the MySQL username, database name, and the filename you wish to create.
mysqldump -u <username> -p <dbname> > <filename>.sql
Import the file using terminal
After uploading the file to your server, you can browse to the location and execute the following command replacing the MySQL username, database name, and the filename you already have.
mysql -u <username> -p <dbname> < <filename>.sql
Yes you can. You just export your database as sql file and import it via phpmyadmin.
Export:
Import:
Note that if you have a very large sql file your host might not let you upload it via this wizard.
On your local machine you need to backup the database in .sql format. Once you do, access phpMyadmin from your cPanel. Click on the database and import the .sql file.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.