3

I am unable to write tab separated text files into specified TSV/ folder using mysqldump on WINDOWS10 (MySQL80 service).

  • The Command prompt (or powershell) is in admin mode.
  • secure-file-priv ="" in my.ini MySQL config file.
  • MySQL was installed on my local computer and I use a localhost connection with the root username.

Command is: mysqldump -T C:\Users\...\20200430_Dump\TSV\ --user root -p database_name

OUTPUT:

mysqldump: Got error: 1: Can't create/write to file 'C:\Users...\20200430_Dump\TSV\table_name.txt' (OS errno 13 - Permission denied) when executing 'SELECT INTO OUTFILE'.

They are many related post on LINUX but I am specifically looking for an solution for WINDOWS

My small hypothesis: Some linux posts suggest that mysqld use a specific user-account (that seems to be mysql in linux but this is unfortunately not documented at all for any OS). So I imagine that when the server is executing INTO OUTFILE queries he needs to have permission for the TSV/ folder, but i do not know how to do give him this permission in WINDOWS.

best

Alexis
  • 1,343
  • 12
  • 15
  • If you give universal write access to the folder in question, does that fix the problem? – Greg Schmidt May 01 '20 at 04:23
  • Universal write access ?. System, my_personal_user account and Administrators (Laptop_name\Administrators) have already full control over TSV/ folder – Alexis May 01 '20 at 04:27

2 Answers2

8

Left click on your TSV/ folder > Properties > Security Tab > Edit > Add

You need to add NETWORK SERVICE in Group or User names with Full control privilege (probably just Write is sufficient).

enter image description here

The mysqldump now works (tested on windows10)

Alexis
  • 1,343
  • 12
  • 15
3

Mysql dump screen

You need to create an empty SQL file and specify the path to it.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41