Thursday, November 17, 2022

mysqldump แยก structure, function, procedure, data

structure + view + trigger

mysqldump --column-statistics=0 --no-data -B -h [host_remote] -u [user_remote] -p[pass_remote] [db_remote] > [file_export.sql]

function + procedure

mysqldump --column-statistics=0 --host=[host_remote] -B --user=[user_remote] --password=[pass_remote] --routines --no-create-info --no-data --no-create-db --skip-opt [db_remote] > [file_export.sql]

data

mysqldump --column-statistics=0 --no-create-info -B -h [host_remote] -u [user_remote] -p[pass_remote] [db_remote] > [file_export.sql]

Add

  • --column-statistics=0 ถ้า mysql server เป็นเวอร์ชั่นเดียวกัน option นี้ไม่น่าจะได้ใช้

Ref

  • https://stackoverflow.com/questions/6175473/mysql-export-schema-without-data

No comments:

Post a Comment