Two questions on MySQL and CGI.

I have a few small CGI scripts that write to and read from the database now but I need to create the database via PHPAdmin myself. There are some scripts out there that actually set up the database itself AND the tables, not just the tables.

How can you do this? How would you get the user's database name, assign privelegdes, setup the MySQL database, etc?

Secondly, is there a way to make the char limit on any of the columns infinite to the point where there are no coded limits? I store URLs sometimes and some are longer than others, some exceeding 150 characters. If I set varchar(200) for everything, that's setting up some dead weight, isn't it? Is there a way to set up the column without imposing a limit? And if so, how bad is this in terms of security?


In reply to setting up mysql database name by coldfingertips

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.