var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Importing .csv into mysql
I am looking to import a local .csv file into my online mysql database.
I have already used phpmyadmin to simply "import" /csv files, but I would like a more automated method to do this.
I thought a .bat file could work, but I am not very familiar with the syntax.
I am also considering a stored proc. since I am comfortable with SQL, although I am unfamiliar with the syntax to get the .csv file.
What are your recommendations?
Ideally, this would eventually become a scheduled job, although it is not the priority for the moment.
The job will be a recurring event, possibly with different .csv filenames and/or different db table names.
There are some cool tools like CSV to MySQL that make it easy to import and export CSV files to and from MySQL - but changing the filenames and database tables on an automated job sounds like a tall order. Maybe you need a custom script.
thanks a lot ill look into this
Originally Posted by
as u want to load a csv file into db.
--u can use "load data infile my.txt into table table1 fields terminated by ',' "
--to automate this job for a 'table' with a 'filename' u can write a shell script which calls the above SQL statement which loads the data and run the script through crontab.
--if ur not using linux shell script follow this procedure in .bat file as i dont know how .bat works or its syntax