Hello Hans:
I have a process that I need to run once a week. Loading many pipe-delimited text files to preexisting MySQL tables. Windows 7
Is there a batch way of doing this using VBS (for example)?
Thanks
Lukas van der Walde
Batch Load text files to MySQL
-
- Administrator
- Posts: 78589
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Batch Load text files to MySQL
I have no experience with MySQL. Perhaps Import data from txt file or excel to Mysql vbscript will give you some ideas. You'll have to adapt the code of course.
Best wishes,
Hans
Hans
-
- Lounger
- Posts: 35
- Joined: 20 Feb 2010, 05:05
Re: Batch Load text files to MySQL
Hans:
Thanks very much! That looks promising.
Lukas
Thanks very much! That looks promising.
Lukas
-
- 5StarLounger
- Posts: 847
- Joined: 24 Jan 2010, 06:35
- Location: A Magic Forest in Deepest, Darkest, Kent
Re: Batch Load text files to MySQL
Hi Lukas, this is very possible and must assume you have the correct permissions on the Windows 7 machine and the correct account that has insert permissions on the My SQL database. The small issue you will have is the batch file will show the username and password as clear text in its content: Use it like thisPiglette wrote:Hello Hans:
I have a process that I need to run once a week. Loading many pipe-delimited text files to preexisting MySQL tables. Windows 7
Is there a batch way of doing this using VBS (for example)?
Thanks
Lukas van der Walde
Code: Select all
set database_name=db_name
mysql –u root --password=pass --database %database_name% < c:/myInsertFile/sql_insert.sql
Jerry
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it
I’ll be more enthusiastic about encouraging thinking outside the box when there’s evidence of any thinking going on inside it