On Sun, 29 Sep 2002 [EMAIL PROTECTED] wrote:

> The script so far is like this:
>
> ./mysql -u 'root' -ppassword
> use import_test1;
>
> When it executes, it just waits at the mysql prompt.  It does not seem to
> recognize that
> I want to input "use import_test1;"
>
> Can anyone help?

Sure! You have to create a script file that contains the SQL statements you
are about to run.

./mysqld -u root -ppassword < myscript.sql

Edit myscript.sql to contain your SQL code.

Best regards,
Iikka

>
> Thanks.
>
> Peter
>
>
> On Fri, 27 Sep 2002, [ISO-8859-1] Iikka Meriläinen wrote:
>
> > Hi,
> >
> > use this: mysql -u root -ppassword
> >
> > It's important NOT to put a space between -p and the real password. Having a
> > password in a script is unsafe at its best, though. I'm not sure if you have
> > any other options than to put it that way or enter it manually each time you
> > run the script.
> >
> > Regards,
> > Iikka
> >
> > On Sat, 28 Sep 2002 [EMAIL PROTECTED] wrote:
> >
> > > Hi Carl,
> > >
> > > Thanks for your reply.
> > >
> > > I have created a shell script but I get stuck on the part where it asks to
> > > input password.
> > >
> > > How do I get the script to input the password that I put in?
> > >
> > > So far my script looks like this:
> > >
> > > ./mysql -u 'root' -p
> > > echo "abc"
> > >
> > > The script executes, but it just waits for the password after it executes
> > > the line:
> > > ./mysql -u 'root' -p
> > >
> > > Can anyone help with this?
> > >
> > >
> > > Thanks.
> > >
> > > Peter
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Mon, 5 Aug 2002, Carl McNamee wrote:
> > >
> > > > I'm assuming that you are using some form of unix in this.  From the system
> > > > prompt type "mysql -u root -ppassword < import_test1".  If this works just
> > > > put it into a script (bash, perl, whatever) and run it either from the
> > > > command line or via cron if you want it automated.
> > > >
> > > > Carl McNamee
> > > > Systems Administrator
> > > > Billing Concepts
> > > > (210) 949-7282
> > > >
> > > > -----Original Message-----
> > > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > > Sent: Saturday, August 03, 2002 11:58 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: automating import process
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I want to try to automate a phonebook list import process into MySQL
> > > > database.  The phonebook was originally created with MS Access and
> > > > exported into a text file.  I upload that text file onto my server and I
> > > > proceed with the following import process.
> > > >
> > > > Using Telnet I type:
> > > > # ./mysql -u 'root' -p
> > > >
> > > > It then asks
> > > > Enter password:
> > > >
> > > > I then select the database to use
> > > > mysql> use import_test1;
> > > >
> > > > I delete the previous phonebook list table because the import process does
> > > > not know that it should replace the previous records even though there
> > > > have been changes
> > > > mysql> use import_test1;
> > > >
> > > > mysql> exit
> > > > Bye
> > > >
> > > >
> > > > I then import by doing the following:
> > > > [root@ns2 bin]# ./mysqlimport --local -u "root" -p
> > > > --fields-terminated-by=, import_test1 phone2.txt
> > > > Enter password:
> > > > import_test1.phone2: Records: 53 Deleted: 0 Skipped: 0 Warnings: 1
> > > >
> > > >
> > > > I was wondering is there anyway to automate this process in a script?
> > > >
> > > > I have never written a script in Linux before.  If I can automate this
> > > > process, what kind of script should I use?
> > > >
> > > > Thanks.
> > > >
> > > > Peter
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > >
> >
> > ******************************************
> > * Iikka Meriläinen                       *
> > * E-mail: [EMAIL PROTECTED] *
> > * Vaala, Finland                         *
> > ******************************************
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
>
>
> ---------------------------------------------------------------------
> 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
>

******************************************
* Iikka Meriläinen                       *
* E-mail: [EMAIL PROTECTED] *
* Vaala, Finland                         *
******************************************


---------------------------------------------------------------------
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