csv - MySQL(5.6) "select * into outfile.." not creating files -


when use command on local host root user runs without issue can't seem find actual file.

select * outfile 'c:\...\tablename.txt'  fields terminated ',' optionally enclosed '"' lines terminated '\r\n' tablename; 

when try run query again says file created when it's not.

edit: fixed query syntax

there unnecessary from after *. query should more this:

select * outfile 'c:\...\tablename.txt' fields terminated ',' optionally enclosed '\r\n' tablename; 

note: make sure mysql has permission write 'c:\...\tablename.txt'

as file being created error:

the file may have been created in directory mysql have permission write to, such data directory. why getting message file has been created have run query more once.

from mysql command line run show variables '%dirdata%';, should see output looks like:

mysql> show variables '%datadir%'; +---------------+-------------------------------------+ | variable_name | value                               | +---------------+-------------------------------------+ | datadir       | c:\wamp\bin\mysql\mysql5.6.17\data\ | +---------------+-------------------------------------+ 1 row in set (0.35 sec) 

navigate in windows folder , should find file there.


Comments