How to get a table creation script in MySQL Workbench?

后端 未结 13 1635
醉梦人生
醉梦人生 2020-12-07 12:17

I am rolling back to MySQL GUI Tools\' MySQL Query Browser since I can\'t find the shortcut to get a table\'s creation script in MySQL Workbench.

相关标签:
13条回答
  • 2020-12-07 12:36

    U can use MySQL Proxy and its scripting system to view SQL queries in realtime in the terminal.

    0 讨论(0)
  • 2020-12-07 12:38

    Solution for MySQL Workbench 6.3E

    • On left panel, right click your table and selecct "Table Inspector"
    • On center panel, click DDL label
    0 讨论(0)
  • 2020-12-07 12:38
    1. Open MySQL Workbench (6.3 CE)
    2. In "Navigator" select "Management"
    3. Then select "Data Export" (Here select the table whose create script you wish to export)
    4. In Drop down select "Dump Structure and Data"
    5. Select checkbox "Include Create Schema"
    6. Click the button "Start Export" Once export is complete it will display the location in which exported file is dumped in your system. Go to the location and open the exported file to find table creation script.

    Or Check https://dev.mysql.com/doc/workbench/en/wb-admin-export-import-management.html

    0 讨论(0)
  • 2020-12-07 12:48

    1 use command

    show create table test.location
    

    1. right click on selected row and choose Open Value In Viewer

    2. select tab Text

    0 讨论(0)
  • 2020-12-07 12:50

    Right-click on the relevant table and choose either of:

    • Copy to Clipboard > Create Statement
    • Send to SQL Editor > Create Statement

    That seems to work for me.

    0 讨论(0)
  • 2020-12-07 12:52

    Not sure if I fully understood your problem, but if it's just about creating export scripts, you should forward engineer to SQL script - Ctrl + Shift + G or File -> Export -> first option.

    0 讨论(0)
提交回复
热议问题