MySQL writing on a text file

2019-05-28 10:43发布

问题:

I'm trying to write data on a text file on MySQL workbench 5.2.45 in a Macbook Pro with Mountain Lion OS 10.8.2; and I get the following mistake:

"Error Code: 1. Can't create/write to file '/Users/JohnnyDahdah/Desktop/datos2' (Errcode: 13 - Permission denied) 0.001 sec"

My code is the following:

select * from Datos into outfile '/Users/JohnnyDahdah/Desktop/datos2.txt';

回答1:

Unless the server is running as you then it does not have permission to write into your home directory. You could probably arrange for you and it to share a group, but it's probably better to get it to write to /tmp and avoid the whole issue.