I have two website environments (separate servers, Media Temple DV): Dev and Production.
We started creating a site on Production, and then we got a Dev server, so I originally converted the Production database to Dev using the following commands:
$ mysqldump -a -u USERNAME -p DATABASE > OUTPUT.mysql
$ gzip OUTPUT.mysql
Then I created the Dev server site and database, moved OUTPUT.mysql and set up the MySQL environment on Dev to import:
$ mysql -u USERNAME -p DATABASE
set up environment for large data import:
mysql> set global net_buffer_length=1000000;
mysql> set global max_allowed_packet=1000000000;
mysql> exit
And imports both data and schema into Dev using these commands:
$ gunzip -f OUTPUT.mysql.gz
$ mysql -u USERNAME -p TARGET_DATABASE_NAME < OUTPUT.sql
Now I have made changes to the structure of the MySQL Dev database, such as adding / removing fields in existing tables and adding tables, and I would like to transfer my changes to Production.
Dev Production , , , ? ( Production, Dev.)
, phpMyAdmin ( , ). , , , script. , - ?
UPDATE. , , PHP script, , ( ) .
script , live local, "SHOW TABLES" MySQL . , , SHOW CREATE TABLE MySQL .
, script , , SHOW COLUMNS FROM $table . MySQL , ALTER TABLE .
, PHP script SQL script , phpMyAdmin.