Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have now a problem that I have to set paths through variables in queries like

load data infile  '/my/file/path/to/file.txt'
into  table  database1.table2
fields terminated by ''
lines terminated by '\r\n'
( id, name_en, name_de, value_en, value_de);

The part "/my/file/path/to/" should be set with a variable, but the only way I have found is to use prepared statements, which is not possible with this type of queries.

Is there any other option to keep the path in a variable?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.