I am with a Linux OS machine and I was wandering if there is an option for importing new files every x minutes into my database (MySQL).
I mean, I receive new files in a directory every x minutes and I know that with HeidiSQL I can import CSV files manually. However, I would like it to be automatic and periodically with a scrpit in my Linux machine. I was thinking about using cron to repetively doing the action, I only do not know if there is a command which imports files to HeidiSQL.
I tried to find it in the Heidi Webpage but it seems there is no information about it.I am also open to other suggestions.
Thank you.
First, you cannot import files into HeidiSQL. Instead, you want to import CSV files into your MySQL/MariaDB server. HeidiSQL is a client for these servers.
Then, HeidiSQL cannot do much scheduled stuff, as it's a graphical client and as such provides only very few command line parameters, which are documented.
But you can use the mysql(.exe on Windows) command line program to do that. Just an example:
path/to/mysql -hlocalhost -uroot -pwhatever --database=yourdb --execute="LOAD DATA LOCAL INFILE 'path/to/your/file.csv' INTO TABLE `foo` CHARACTER SET utf8 FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' (`fooid`, `foosubid`, `fooname`)"