Is there a tool that can visually map table relationships in MySQL? - mysql

I'm looking for a tool that can map the relationships in my database in mysql. I would like something like the view that is generated in MS-SQL Server Management Studio in the 'Show Diagram Pane'. Does such a thing exist?
I'm in charge of the design of the database and its using rails conventions. I would not be adverse to specifying relationships by hand.

Doesn't MySQL Toad have a schema diagram tool? I think it does. I'm not a diagram guy (much happier with mysqldump output) but I've worked with many people who swear by Toad.

Maybe the official tool has that?
http://dev.mysql.com/downloads/workbench/5.1.html

MySQL Workbench 5.1.16 is buggy on my OS X 10.5.7 system. I found that it does things like crashes and vanishes with no error. Or it will error out when trying to change page size in the print setup.
I also tried running it on Windows XP under VMWare. It seemed more stable and usable there. I was able to reverse engineer a DB and create a diagram.

One year ago I used DBVis together with Oracle. It believe it also works with MySql.

Altova DatabaseSpy will show them if you are on Windows. If not, the easiest way is to query INFORMATION_SCHEMA (if you're using v5 or later of MySQL) and check out the key column usage statistics for all the tables. This is easy to script.

Most MySQL databases still use MyISAM tables, which do not provide foreign key constraints. Without explicit FKs the best you can do is guess at the relationships between tables.

Related

Tool for table_schema and table_name relationship

Do you know any tools for profiling,to see the structure and relationship of each tables inside the db? it is look like this one :
See screenShot below,
For bigger resolution, Please click here.
Thanks In advance.
Any help much more appreciated! :)
MySQL Workbench is what youre looking for
http://www.mysql.com/products/workbench/
You could use the MySQL Workbench, if I remember correctly it has a function, which can do this (reverse engineer database or something similar).
See this SO post.
Have a look at Database Designer for MySQL in dbForge Studio for MySQL.
Database Designer is a powerful visual design tool for database development that allows you to build a clear and effective database structure visually and to see the complete picture representing all the tables, foreign key relations between them, views, and stored routines of your database on database diagrams.
Toad for MySQL has a Database Diagram feature allowing you to create such drawings from existing databases.
SchemaCrawler for MySQL is a free command-line tool that diagrams databases. SchemaCrawler is particularly useful when diagramming large and complex schemas, since it can diagram tables based on the results of regular expression searches of table and column names.
Sualeh Fatehi, SchemaCrawler

MySQL phpmyadmin alternatives (mySQL workbench like)

I'm familiar with MS SQL server 2008 and I want to switch to an more open minded/source DBMS;
I found out that phpmyadmin is the most widely used tool to manages mySQL databases but I find it very difficult to work with. In SQL server I was used to create tables from the designer (in diagram -> add new table) and only if I needed some extra features I actually modified the table.
Can I do the same thing from phpmyadmin? I really hate that every time I create a new table to be asked how many rows it will have and there are plenty of options displayed even if I do not use them.
So any alternatives???
P.S. mySQL workbench seems the right tool for me but I think you are not able to create tables from the designer only to edit existing tables. (Correct me if I'm wrong)
You can create table in MySQL workbench using designer interface, If you are looking for alternatives try HeidiSQL or SQLYOG, for more options visit this.
you can create table visually using workbench.
Check out this article
http://net.tutsplus.com/tutorials/databases/visual-database-creation-with-mysql-workbench/
I recommend Chive for a simple web based solution
Try Webdbadmin.
http://www.webdbadmin.com is what I recommend you.
Works like a desktop app, but it's web-based.

Synchronizing tables on 2 MySQL servers

I have 2 MySQL servers: one for development, other for production. Both contain same table structure, but different data on tables.
When I have done change on dev server, like add column to table, I have manually made the same change later to production server. But this slow and error prone, especially if there are many changes to be made at once.
Is there better way to do this? I have phpMyAdmin, maybe that has some neat trick?
Also, is there a dedicated term for what this process is called? Searching for 'table update' or similar does not yield results on this topic.
EDIT:
Forgot to mention that I am using Windows.
So apparently I need some kind of diff tool for this. I haven't tested all of these proposed software yet, but so far they seem very useful.
I've used Red Gate's SQL Compare before for SQL Server; this is their MySQL product. I don't have the budget to buy it myself, but if it works anything like SQL Compare did, it'll do exactly what you want it to do.
When ever I do this I have used the data or structure sync in a Mysql GUI app called Navicat, there is a free version available and it does what you asked perfectley.
Try to compare and synchronize databases with schema/data comparers in dbForge Studio for MySQL.

1 click Mysql schema to diagram convert?

I have so many tables and FK relationships it is hard to keep track and visualze it all. Speard across multiple excel documents. I have it already entered in mysql but I want to output a data model diagram that links tables together along with all the FKs.
How to do it apart from manually having to do it? I am open to 3rd part tools as long as they are free.
Well I am using phpMyAdmin on my local server.
phpMyAdmin 3 has this Designer feature that shows you the linkages between various tables and its columns.
Take a look at the MySQL Workbench.
It's a free tool and offers a few nice features like forward and backward engineering and database synchronisation. I has a few bugs, but its the best tool for MySQL I know so far.

How to synchronize development and production database

Do you know any applications to synchronize two databases - during development sometimes it's required to add one or two table rows or new table or column.
Usually I write every sql statement in some file and during uploading path I evecute those lines on my production database (earlier backing it up).
I work with mySQL and postreSQL databases.
What is your practise and what applications helps you in that.
You asked for a tool or application answer, but what you really need is a a process answer. The underlying theme here is that you should be versioning your database DDL (and DML, when needed) and providing change scripts to be able to update any version of your database to a higher version.
This set of links provided by Jeff Atwood and written by K. Scott Allen explain in detail what this ought to look like - and they do it better than I can possibly write up here: http://www.codinghorror.com/blog/2008/02/get-your-database-under-version-control.html
For PostgreSQL you could use Another PostgreSQL Diff Tool . It can diff two SQL Dumps very fast (a few seconds on a db with about 300 tables, 50 views and 500 stored procedures). So you can find your changes easily and get a sql diff which you can execute.
From the APGDiff Page:
Another PostgreSQL Diff Tool is simple PostgreSQL diff tool that is useful for schema upgrades. The tool compares two schema dump files and creates output file that is (after some hand-made modifications) suitable for upgrade of old schema.
Have scripts (under source control of course) that you only ever add to the bottom off. That combined with regular restores from your production database to dev you should be golden. If you are strict about it, this works very well.
Otherwise I know lots of people use redgate stuff for SQLServer.
Another vote for RedGate SQL Compare
http://www.red-gate.com/products/SQL_Compare/index.htm
Wouldn't want to live without it!
Edit: Sorry, it seems this is only for SQL Server. Still - if any SQL Server users have the same question I'd definitely recommend this tool.
If you write your SQL statements for your development database (which are, I imagine, series of DDL instructions such as CREATE, ALTER and DROP), why don't you keep track of them by recording them in a table, with a "version" index? You will then be able to:
track your version changes
make a small routine allowing the "automatic" update of your production database by sending the recorded instructions to the database.
I really like the EMS tools.
There tools are available for all popular DB's and you have the same user experience for every type of DB.
One of the tools is the DB Comparer.
TOAD
saved many an ass several times in the past. Why do people run sql with no exit strategy?
the redgate one is good also.
Siebel (CRM, Sales, etc. management product) has a built-in tool to align the production database with the development one (dev2prod).
Otherwise, you've got to stick with manually executed scripts.
Navicat has a structure synchronisation wizard that handles this.
I solve this by using Hibernate. It can detect and autocreate missing tables, columns, etc.
You could add some automation to your current way of doing things by using dbDeploy or a similar script. This will allow you to keep track of your schema changes and to upgrade/rollback your schema as you see fit.
Here's a straight linux bash script I wrote for syncing Magento databases... but you can easily modify it for other uses :)
http://markshust.com/2011/09/08/syncing-magento-instance-production-development
DBV - "Database version control, made easy!" (PHP)