Re: [PHP] MySQL DB Schema

2003-02-18 Thread David Otton
On Tue, 18 Feb 2003 09:23:52 -0800, you wrote:

Greetings all,

Is there an easy way to pull out the schema of a MySQL for viewing??

You want the tables and the relationships between them? Not easy to get
the links because of the lack of foreign keys in MySQL.

If you want a table, DESC tablename.

If you want to capture the create statements for the tables, mysqldump
-d databasename  filename.sql


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MySQL DB Schema

2003-02-18 Thread Erik Price

On Tuesday, February 18, 2003, at 12:23  PM, Phillip S. Baker wrote:


Is there an easy way to pull out the schema of a MySQL for viewing??


If you have access to the command line (either directly or via the 
system() function), try this:

bash 2.05 $  mysqldump -t databasename --user=username --password



Erik





--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL DB Schema

2003-02-18 Thread Erik Price

On Tuesday, February 18, 2003, at 12:39  PM, David Otton wrote:


You want the tables and the relationships between them? Not easy to get
the links because of the lack of foreign keys in MySQL.


You can add a comment to your table with the COMMENT modifier, which 
gives you 60 characters to describe your table's relationship to other 
tables.

(In a table named registrants, you could have the comment

  registrants.user_id = users.user_id

)

http://www.mysql.com/doc/en/CREATE_TABLE.html



Erik




--
Erik Price

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php