I have a text file placed in the Users directory on a Mac, called 'data.txt'
I want to use a php-script to push data from that file into a MySQL table located on a remote server.
I first try the phpmyadmin tool to do this and it gives me the proper query lines that it used to succeed. But the filename/path itself (in the query) is said to be:
/tmp/phpNA1yy4w
instead of
/Users/data.txt
where the file really is located
LOAD DATA INFILE '/tmp/phpNA1y4w' INTO TABLE `mytable` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r'
When I do this several times the path changes but always with tmp as the folder. Looks like an encrypted filename. Data comes into the table as I was hoping.
But when I try to run the following query:
LOAD DATA INFILE '/Users/data.txt' INTO TABLE `mytable ` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r'
I get (-1 lines inserted) as a result (note the '-' !) and nothing comes in to the table.
Maybe this is a security issue. Any suggestions?
I want to use a php-script to push data from that file into a MySQL table located on a remote server.
I first try the phpmyadmin tool to do this and it gives me the proper query lines that it used to succeed. But the filename/path itself (in the query) is said to be:
/tmp/phpNA1yy4w
instead of
/Users/data.txt
where the file really is located
LOAD DATA INFILE '/tmp/phpNA1y4w' INTO TABLE `mytable` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r'
When I do this several times the path changes but always with tmp as the folder. Looks like an encrypted filename. Data comes into the table as I was hoping.
But when I try to run the following query:
LOAD DATA INFILE '/Users/data.txt' INTO TABLE `mytable ` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r'
I get (-1 lines inserted) as a result (note the '-' !) and nothing comes in to the table.
Maybe this is a security issue. Any suggestions?