Can't create/write to file 'xxxx.txt' (Errcode: 13 - Permission denied)

Viewed 49234
mysql> \T abc.txt
./mysql: Can't create/write to file 'abc.txt' (Errcode: 13 - Permission denied)
Error logging to file 'logPremiereQueries.txt'

I meet the same problem when I use Windows 8. I solve it by running cmd (MySQL 5.6 Command Line Client) as administrator. And then I could easily find the position of abc.txt. However, in Mac OS X, I do not know how to change the permission. And if log to file successfully, where to find this 'abc.txt'? Any ideas? Thank you very much!

5 Answers

I work with windows 10 and, I also faced this problem when I used 'TEE'/'tee'/'\T' command. I solved it using these steps. First, we have to create a text file in a notepad and save it. Then copy the file path and use it with the tee command. Don't forget to convert the backslashes to forward slashes. Ex: TEE C:/Users/User-PC/Desktop/sqlfile.txt

Related