如何从 MySQL/phpMyAdmin 中提取数据库模式?
有什么方法可以提取 mysql 数据库的架构吗?
我在这些数据库中有很多数据库和表,并且我在本地计算机上使用 phpmyadmin 和 WAMP。
我需要提取模式,或者至少数据库名称、表名称、列及其属性(例如INT(2)
)并将其导出为csv/excel/最终可以编辑的任何格式在Excel中。
我使用:
服务器:
Apache/2.2.21 (Win64) PHP/5.3.8 MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ PHP extension: mysqli Documentation
mysql:
Server: localhost (localhost via TCP/IP) Server version: 5.5.16-log Protocol version: 10 User: root@localhost MySQL charset: UTF-8 Unicode (utf8)
谢谢!
is there some way of pulling out the schema of your mysql databases?
I have lots of db and tables inside these databases, and I use phpmyadmin with WAMP in my local machine.
I need to pull out the schema, or atleast the database name, table name, columns and their attributes (e.g. INT(2)
) and export it as csv/ excel/ whatever format which finally can be edited in excel.
i use:
server:
Apache/2.2.21 (Win64) PHP/5.3.8 MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ PHP extension: mysqli Documentation
mysql:
Server: localhost (localhost via TCP/IP) Server version: 5.5.16-log Protocol version: 10 User: root@localhost MySQL charset: UTF-8 Unicode (utf8)
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
不确定你到底想要什么。您可以尝试以下方法之一:
1) 使用 phpMyAdmin 的导出功能导出数据库。 PMA 允许您省略数据,以便获取所有
CREATE TABLE
语句。2) 您可以使用 mysqldump 执行相同操作。此命令应导出 CREATE DATABASE/CREATE TABLE 查询:
3) 您可以从 mySQL 模式表中提取信息。大多数 mySQL 客户端(phpMyAdmin、HeidiSQL 等)允许您将查询结果导出为 CSV。一些有用的查询:
Not sure exactly what you want. You can try one of these methods:
1) Use phpMyAdmin's export feature to export the database. PMA allows you to omit the data so get all
CREATE TABLE
statements.2) You can do the same using mysqldump. This command should export CREATE DATABASE/CREATE TABLE queries:
3) You can pull information from mySQL schema tables. Most mySQL clients (phpMyAdmin, HeidiSQL etc) allow you to export result of queries as CSV. Some useful queries: