开发者

How do I upload new data-base structure into mysql from my development db?

开发者 https://www.devze.com 2022-12-22 05:29 出处:网络
we\'ve been making changes in the MySQL database, adding tables, columns and so forth and I have a deve开发者_开发知识库lopment/staging site and production. All are MySQL, staging and production hoste

we've been making changes in the MySQL database, adding tables, columns and so forth and I have a deve开发者_开发知识库lopment/staging site and production. All are MySQL, staging and production hosted remote.

How do I export the table structure and bring it into the production environment?

I have been using phpMyAdmin to administer it to date.


On local dev system:

$ mysqldump -u username -p databasename > export.sql

On remote system:

$ mysql -u username -p databasename

mysql> source pathto/export.sql


Check out mysqldump, a command line tool that comes with MySQL, here:

  • http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

Using it, you can take a snapshot of both the structure and the data of your database and import it elsewhere.

0

精彩评论

暂无评论...
验证码 换一张
取 消