I am using MySQL v5.1 on Ubuntu machine.
MySQL data directory is
I have a
test.dat file located on
I would like to load data from the
test.dat file into my database table, so I execute the following SQL statement:
LOAD DATA INFILE '/var/lib/mysql/tmp/test.dat' INTO TABLE myapp.cars;
But I got the following error:
Mysql2::Error: Can't get stat of '/var/lib/mysql/tmp/test.dat' (Errcode: 2): LOAD DATA INFILE '/var/lib/mysql/tmp/test.dat'
What could be the reason??
P.S. one thing come to my mind is that
/var/lib/mysql/ can only be accessed by root user, but I am not sure if it is the reason.