Quick and Dirty MySQL Diagrams on OSX with EOModeler · 510 words posted 06/08/2007 05:45 PM

Whenever I take on a new project with an existing database the first thing I like to do is generate an entity diagram of all the tables. On OSX you can buy or download any number of third party packages to model tables, but here’s how to do it with software you already own: WebObjects and EOModeler.

The executive version:

Create a MySQL database with Foreign Key relationships; then install the proper JDBC driver for MySQL; finally point EOModeler to your database to generate the diagram.

Although these steps are covered in various places on the web, here’s the whole thing step by step in detail. I assume you have MySQL 5 and OSX 10.4.9.

cd ~/Desktop/mysql-connector-java-5.0.6 sudo cp mysql-connector-java-5.0.6-bin.jar /Library/Java/Extension [Enter your password when prompted] jdbc:mysql://localhost/yourdatabasenamehere

Schweet! You can save the generated diagram and reopen it in Xcode. You should end up with a diagram that looks something like the image below, foreign keys and all. Tip: if you end up with am archipelago of unconnected tables, you’re probably working with MyISAM tables instead of InnoDB.

Questions? Post them in the comments here. Just don’t expect any replies Sunday night. I’ll be respecting the Bing.

* * *