Convert your MySQL schema to a Dia Diagram

Written by James McDonald

April 25, 2013

Do this Creating DIA diagrams from mysql via XSLT

The XSLT

(echo "<root>";
mysql --user=root -p -A -D maps \
-e 'desc assigned_tos  ; \
desc map_histories; \
desc map_types; \
desc maps' -X |\
grep -v "<?xml" ;\
echo "</root>") > /tmp/tmp.xml
xsltproc sql2dia.xsl /tmp/tmp.xml |\
  gzip -c > file.dia

In 2013 the original post still works fine:

I added relationships and got this diagram:

db_dia

Incidentally the naming conventions for the schema above comes from the CakePHP Database Conventions. I’ve always found it challenging to have sensible database table and field conventions but CakePHP has a good method of naming its Database Schema which makes sense to me.

 

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...