6 月 192014
 

导出完整数据库
mysqldump -u username -p password dbname > dbname.sql

只导出表结构
mysqldump -d -u username -p password dbname > dbname.sql

只导出数据库中指定表的表结构
mysqldump -d -u username -p password dbname tablename > tablename.sql

导出数据库中指定表的表结构和数据
mysqldump -u username -p password dbname tablename > tablename.sql

只导出指定表中的数据
mysqldum -t -c -u username -p password dbanme tablename > tablename.sql
# mysqldump –help

导出含有BLOB格式的数据库

/usr/bin/mysqldump -uroot -p password -R -q –hex-blob abc > /tmp/abc.sql

-c, –complete-insert
Use complete insert statements.

-t, –no-create-info
Don’t write table creation info.

-d, –no-data No row information.

-p, –password[=name]
Password to use when connecting to server. If password is
not given it’s solicited on the tty.

-u, –user=name User for login if not current user.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)