How can I load data in a text file into a specific field. It's a 30 line log file from some copy operations; nothing fancy. I just want to store it as large text or a blob.
The examples I am able to find are all for loading a text file into a table.
Here's what my DB looks like:
+----+---------------------+---------------------+------+------------+------------------------------+
| id | LastStart | LastFinish | Log | ExitStatus | TaskName |
+----+---------------------+---------------------+------+------------+------------------------------+
| 1 | 2012-06-26 10:41:17 | 2012-06-26 10:47:42 | NULL | NULL | LouPrMgt004.Backup |
| 2 | NULL | NULL | NULL | NULL | LouPrMgt004.LoadPrtgDataToDb |
+----+---------------------+---------------------+------+------------+------------------------------+
So I just want to insert the text file "/root/copy.log" into the "Log" field.
Log files will all be different but here's one of them:
2012/06/26 08:35:53 [6952] building file list
2012/06/26 08:35:53 [6952] .d...p..... ./
2012/06/26 08:35:53 [6952] <f..t...... LouPrMgt004-backup-www.tar.gz
2012/06/26 08:35:53 [6952] <f..t...... MySQL_ServerInfo.sql
2012/06/26 08:35:53 [6952] <f..t...... MySQL_nmap_scan.sql
2012/06/26 08:35:53 [6952] <f..t...... packagelist.log
2012/06/26 08:35:53 [6952] <f.st...... root.tar.gz
2012/06/26 08:35:53 [6952] sent 60.14K bytes received 30.44K bytes 13.94K bytes/sec
2012/06/26 08:35:53 [6952] total size is 19.26M speedup is 212.63
2012/06/26 10:41:31 [8159] building file list
2012/06/26 10:41:31 [8159] .d...p..... ./
2012/06/26 10:41:31 [8159] <f.st...... LouPrMgt004-backup-www.tar.gz
2012/06/26 10:41:31 [8159] <f.st...... MySQL_ServerInfo.sql
2012/06/26 10:41:31 [8159] <f.st...... MySQL_nmap_scan.sql
2012/06/26 10:41:31 [8159] <f..t...... packagelist.log
2012/06/26 10:41:31 [8159] <f.st...... root.tar.gz
2012/06/26 10:41:32 [8159] sent 7.85M bytes received 30.44K bytes 630.61K bytes/sec
2012/06/26 10:41:32 [8159] total size is 19.27M speedup is 2.44

/root/copy/log. – RolandoMySQLDBA Jun 26 '12 at 16:03