E
E
enchikiben2013-06-26 13:48:03
MySQL
enchikiben, 2013-06-26 13:48:03

Database structure dump + data from one table?

Good afternoon, tell me how you can export the database structure + data from one specific table.
The problem is the following, there is a yii migration table that stores which migration was applied, and I want to save this data so that when transferring to a new server, execute sql and not perform the migration again.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AgentSIB, 2013-06-26
@AgentSIB

mysqldump -u USER -p DATABASE TABLENAME > dump.sql
USER, DATABASE and TABLENAME replace with the ones you need

Z
zapimir, 2013-06-26
@zapimir

You can use Sypex Dumper .
There, select the desired database, in the list of objects, click on the Tables checkbox, the black square in the checkbox means that only the structure will be copied, and then make a couple of clicks on the checkbox of the desired table that needs to be backed up completely. Then click Run. For example, in the screenshot of all tables, only the structure is dumped, and jl_associations is completely dumped.

If, when restoring a table with data, you do not want to delete the table and create it again. You can use the recovery strategies INSERT IGNORE (so that only new data is added to the table), or REPLACE (so that the data from the dump replaces the data in the database).
If you need to do such a dump regularly, then click Save, after which the task can be performed from the Export drop-down menu. Or by crown.

A
Alexander Chernykh, 2017-07-29
@sashkets

dump script of the database structure and all tables
https://4admin.info/dump-tables-mysql/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question