Jump to content

[SOLVED] Any tools out there to give a nice graphic display of mysql tables?


Recommended Posts

Wondering if there are any tools out there that can read a mysql DB structure and give a nice graphic display of the tables, their fields and their settings.  Something like a Visio drawing?

 

Myphpadmin has a few export options, but the only thing that comes close is the Word export

Hi

 

I too started using SQLyog, but could manage to get only the trial version (26 days).

Any possibility to get a free non-trial version ??

 

Cheers

Hari.

 

You can use the Community Edition..

URL: http://webyog.com/en/downloads.php

Here's a simple script to display table structures.

 

Call with "schema.php?db=dbname&cols=4"

 

defaults:

db=test

cols=3

 

::schema.php::

<?php
mysql_connect('localhost');
mysql_select_db('information_schema');

$numcols = isset($_GET['cols']) ? $_GET['cols'] : 3;
$db = isset($_GET['db']) ? $_GET['db'] : 'test';

$sql = "SELECT C.TABLE_NAME, GROUP_CONCAT(C.COLUMN_NAME SEPARATOR '<br/>') as cols
        FROM `COLUMNS` C
        WHERE C.TABLE_SCHEMA='$db'
        GROUP BY C.TABLE_NAME";
        
$res = mysql_query($sql) or die (mysql_error()."<p>$sql</p>"); 
?>
<html>
<head>
<meta name="generator" content="PhpED Version 4.5 (Build 4513)">
<title>DB Tables</title>
<meta name="author" content="Barand">
<meta name="creation-date" content="12/29/2007">
<style type='text/css'>
DIV.container {
    float: left;
    margin: 30px;
    width: 200px;
}
DIV.table {
    background-color: #B8D3D3;
    color: #000;
    font-weight: 600;
    font-size: 9pt;
    text-align: center;
    padding: 8px;
    border: 1px solid gray;
}
DIV.cols {
    font-size: 9pt;
    background-color: #F0F0F0;
    color: #000000;
    text-align: left;
    padding: 8px;
}
BR {
    clear: both;
}
</style>
</head>
<body>
<?php 
     $k = 0;
     while (list($table, $cols) = mysql_fetch_row($res))
     {
        echo "<div class='container'>\n";
        echo "<div class='table'>$table</div>\n";
        echo "<div class='cols'>$cols</div>\n"; 
        echo "</div>\n";
        if (++$k % $numcols == 0) echo "<br />\n";
     }
?>
</body>
</html>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.