Recently, I started to use MySQL database for project development. Although I used MySQL database in university, I used Navicat for again MySQL, in addition to the familiarity of other basic operations seem to have forgotten, now the use of problems as a blog record, but also for their own future use of more familiar than now.

demand

Table replication in the database

  • Because you create a table that has many of the same standard fields, the quickest way is to copy a table and then add some changes.
  • But try to operate through the interface, it seems not to achieve
  • You can copy tables by modifying SQL statements on the command line and then executing SQL statements

Export of SQL statements in a view

  • When using PowerDesign to create a database model, you need to export the SQL statements of database tables and views in MySQL database
  • The SQL statement of the database table can be right – click everywhere to have the SQL statement export
  • SQL statements from database views cannot be exported this way

The solution

Replication of database tables

  • Click database right click to see the command line interface options in the drop-down menu box, click the command line interface options to enter the command line interface

  • Copy the SQL statement of the table on the command line interface. After modifying the SQL statement field, you can copy the database table

Export of SQL statements in a view

  • Start by backing up the view of the database

  • Extract the SQL in the backup database view