A
A
amstr1k2013-11-26 13:00:37
PHP
amstr1k, 2013-11-26 13:00:37

mysql database dump

There are 2 functions in php that do the following:
1. Creates a database schema.
2. Creates a data dump to this database

mysqldump -uUSER -pPASSWORD -hlocalhost -d --default-character-set=utf8 --quote-names --allow-keywords --add-drop-table --set-charset --result file=/path/to/file/schema.mysql

mysqldump -uUSER -pPASSWORD -hlocalhost --ignore-table=PROJECT.schema_info-t --default-character-set=utf8 --add-drop-table --create-options --quick --allow-keywords --max_allowed_packet=16M --quote-names --complete-insert --set-charset --result-file=/path/to/file/data.mysql

When creating schema.mysql, it is necessary to take data from the schema_info table and put it in schema.mysql. And when creating data.mysql, take all the data except the data in schema_info and push it into data.mysql

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Sundukov, 2013-11-26
@alekciy

mysqldump -uUSER -pPASSWORD -hlocalhost -d --default-character-set=utf8 --quote-names --allow-keywords --add-drop-table --set-charset schema_info > /path/to/file/schema.mysql

man mysqldump

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question