mysql 8 file creation issue

25 views
Skip to first unread message

Aadil Rashid

unread,
Mar 18, 2022, 12:48:47 AM3/18/22
to Django users

When I run this query on mysql 5.7:

SELECT CURDATE() INTO OUTFILE '/var/lib/mysql-files/test.csv';

It creates test.csv with the following permissions:

-rw-rw-rw- 1 mysql mysql 11 Mar 18 04:27 test.csv

But when I create the same file in mysql 8.0 it creates file with the following permissions:

-rw-r----- 1 mysql mysql 11 Mar 18 09:54 test.csv

How would I allow mysql 8 to create file with the same permissions it created with mysql 5.7 ? The reason being I need to read and write to that generated file later in my application.

Antonis Christofides

unread,
Mar 18, 2022, 5:22:35 AM3/18/22
to django...@googlegroups.com

I'm not certain, but it doesn't look to me as a MySQL version issue. It's more probably a umask issue. Search for "umask" and you'll probably find the answer.

However, it's likely that this is suboptimal and risky. It would probably be better to run `mysql` (or whatever mysql client you are using) as the same operating system user as the one who will read and write the csv file later.

Regards,

Antonis

Antonis Christofides
+30-6979924665 (mobile)
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5292768f-f3f4-4973-aea2-ecceb1cda299n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages