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

Reply via email to