in reply to Re^2: How to query mysql database schema with DBI
in thread How to query mysql database schema with DBI

As for creating via a cgi program, I'm just playing right now. It would never be part of a running program. Just a script that's run once to create the schema, then removed.

But I'm open to better suggestions if you have one!

  • Comment on Re^3: How to query mysql database schema with DBI

Replies are listed 'Best First'.
Re^4: How to query mysql database schema with DBI
by shemp (Deacon) on Oct 04, 2004 at 22:50 UTC
    My preferred method of creating tables is to put the create statement in a text file with a meaningful name, such as mytable_schema_2004_10_04.sql

    Then from the unix command line you can just:

    cat mytable_schema.sql |mysql -u [user] -p
    This way, you have a copy of the original schema.

    If it doesnt create correctly, you can modify the file easily enough to fix the problem.

    If you ever make changes with ALTER, the original schema is still available.

    Also, if you ever want to make an identical table, you already have the schema, or if you want to make a similar table, you can modify a copy of this file.

    Yeah, in a lot of ways its like doing it from a script that you can run over and over, but doing it from a script is more complicated and less portable.

Re^4: How to query mysql database schema with DBI
by dragonchild (Archbishop) on Oct 04, 2004 at 21:08 UTC
    Wht's wrong with using the mysql client program? Or, MySQL AB has a number of graphical clients you can use.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.