Andre Kirchner wrote:
> Hi there,
>
> is there a way to execute sql commands from a file?
> What would be the syntax to do it?
> I was trying mysql> @theFile, but it doesn't work.
>
> Thanks,
>
> Andre
>
> __________________________________________________
> Do you Yahoo!?
> Y! Web Hosting - Let the expert host your web site
> http://webhosting.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
Andre,
If you store your password in ~/.my.cnf
you should be able to use
/usr/bin/mysql -u user_name database_name < file_name_with_sql
If you're using linux/unix, you can something like this to your .bashrc
sq ()
{
/usr/bin/mysql -u user_name database_name < $1
}
which will let you do
sq file_name_with_sql
walt
---------------------------------------------------------------------
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