
June 2nd, 2000, 01:59 AM
|
|
Contributing User
|
|
Join Date: Jun 1999
Location: Seattle
Posts: 133
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
You could use the mysqlimport utility to read in a flat file. Using one of the options to the import utility, you can specify a string that delimits your fields:
mysqlimport -u user -ppassword --fields-terminated-by='::' dbname flatfile.txt
Or you could write a quick perl script that dumps your flatfile into INSERT statements, then feed that file into the mysql utility with the stdin redirect:
mysql -u user -ppassword dbname < sqlstuff.txt
You have to make sure that the database exists in MySQL before you use either of those methods. If you use the INSERT statement file, you could define your database before the INSERT statements.
Don
[This message has been edited by donarb (edited June 02, 2000).]
|