如何转储mysql表结构没有数据与SQL查询? [英] How to dump mysql table structure without data with a SQL query?

查看:204
本文介绍了如何转储mysql表结构没有数据与SQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要导出一个mysql表,但它有5gb的条目,所以我只想要的结构。

I need to export a mysql table, but it has like 5gb of entries, so I only want the structure. I am trying to do it from a simple php doing a sql query, how can I do that?

推荐答案

你可以使用< a href =http://dev.mysql.com/doc/refman/5.0/en/show-create-table.html> SHOW CREATE TABLE

You can use SHOW CREATE TABLE for this.


显示
创建给定表的CREATE TABLE语句。语句
需要
表的SELECT特权。从MySQL 5.0.1开始,这个
语句也适用于视图。

Shows the CREATE TABLE statement that creates the given table. The statement requires the SELECT privilege for the table. As of MySQL 5.0.1, this statement also works with views.

例如:

SHOW CREATE TABLE MyTablename

这篇关于如何转储mysql表结构没有数据与SQL查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆