How to uses mysqldump to get structure or schema data only

Posted In Database - By Tum. On Tuesday, September 3rd, 2013 With 0 Comments

mysql-logo
โดยทั่วไปแล้วเราจะใช้ mysqldump ในการ export ข้อมูลของ database ออกมาซึ่งข้อมูลที่ export ออกมาจะมีทั้ง structure (schema) และข้อมูลของ database นั้นๆ แต่ถ้าหากต้องการ export เฉพาะ structure (schema) ของ database อย่างเดียวให้เพิ่ม option -d หรือ –no-data เข้าไปก็จะสามารถ export ออกมาแค่ structure (schema) เท่านั้น

ตัวอย่างการ export database เฉพาะ structure (schema) บน MySQL

  • export structure (schema) ทุก table บน database

    หรือ
  • export structure (schema) เฉพาะ table บน database

โดยที่

  • database_name คือ ชื่อ database
  • table_name คือ ชื่อ table

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*