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.
Asked
Active
Viewed 2,682 times
3 Answers
0
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.

Issa Fram
- 2,556
- 7
- 33
- 63
-
executing it locally means? It contains the create table statements. – Dwayne Johnson Oct 24 '11 at 03:54
-
install an instance of MySQL on your laptop/PC at home. and actually run that SQL script against it. – Issa Fram Oct 24 '11 at 03:56
-
1But I want to reverse engineer the scripts to a database diagram visually. – Dwayne Johnson Oct 24 '11 at 03:58
-
Exact question asked before (and answered well) : http://stackoverflow.com/questions/433071/good-tool-to-visualise-database-schema – Issa Fram Oct 24 '11 at 04:01
0
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.

Whetstone
- 1,199
- 8
- 8
0
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.

Icarus
- 63,293
- 14
- 100
- 115