LOAD DATA INFILE
When locating files on the server host, the server uses the following rules:
· If an absolute pathname is given, the server uses the pathname as is.
· If a relative pathname with one or more leading components is given, the server searches for the file relative to the server's data directory.
· If a filename with no leading components is given, the server looks for the file in the database directory of the current database.
Note that these rules mean a file given as ./myfile.txt is read from the server's data directory, whereas a file given as myfile.txt is read from the database directory of the current database. For example, the following LOAD DATA statement reads the file data.txt from the database directory for db1 because db1 is the current database, even though the statement explicitly loads the file into a table in the db2 database: