有没有办法对sql表创建脚本进行逆向工程?
我已经从 phpmyadmin 'data.sql' 导出了我的 sql 语句。我希望对 sql 文件进行逆向工程以显示关系数据库图表。有办法吗?我尝试了 Visio 等工具,它不接受 .sql 文件。
I have exported my sql statements from phpmyadmin 'data.sql'. I wish to reverse engineer the sql file to display the relational database diagram. Is there a way? I tried tools such as Visio, it is not accepting .sql files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尽管您不会获得数据类型,但它应该非常简单。 data.sql 应该显示列名和表名,从那里可以非常简单地跳转到组装表。
It should be very simple, although you won't get datatypes. The data.sql should show you column names and table names, from there it's a pretty simple jump to assembling the table.
这不是逆向工程,但您当然可以使用 MySql Workbench 从现有数据库创建 ER 图。
对于 SQL Server,SSMS 可以选择生成数据库图表。
That's not reverse engineering but you can certainly use tools such as MySql Workbench to create ER Diagrams from existing databases.
For SQL Server, SSMS has an option to generate Database diagrams.
只在本地执行它,然后从那里查看所有表、视图、数据等怎么样?一切都取决于 data.sql 实际包含的内容。如果只有插入语句,您只能猜测模式。如果是 CREATE TABLE 语句,你会更幸运。
How about just executing it locally, and then look at all the tables, views, data, etc from there? All depends on what data.sql actually contains. If its insert statements only, you can only guess on the schema. If it is CREATE TABLE statements, you will have more luck.