First off...  there is a space between the -u and the username (it might 
work without it, haven't tried).

You don't have to put a dabase name before the < as long as there is 
something in the SQL file you're feeding MySQL.  Make a

CREATE DATABASE temp;
USE DATABASE temp;

sql here
sql here
sql here
sql here

And you'll be fine.

At 09:02 AM 5/4/2001 -0700, Brian Warn wrote:
>Might be a case of the blind leading the blind here (list folks: please
>correct me if I'm way off base ...)
>
>I believe that one way to do this would be to create a file with any SQL
>commands you want to run and then redirect it to mysql via back ticks:
>
>`mysql -uroot < sql_command_file`;
>
>Normally, mysql expects a table listed after -uroot, but it might work if
>sql_command_file has 'create database <db name here>' in it.
>
>-Brian
>
>----- Original Message -----
>From: <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, May 04, 2001 8:34 AM
>Subject: some question about create db
>
>
> > I have to create a database from an application (written in perl)
> > how can I do?
> > how can I create a db if the user is not a root?
> > which command can I use?
> > Thank you in advance, Mario.
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
><[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Scott Baker - Webster Internet - Network Technician
503.266.8253 - [EMAIL PROTECTED]

"By working faithfully eight hours a day you may eventually get to be boss 
and work twelve hours a day." - Robert Frost, 1874 - 1963











---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to