SELECT Statement is 0640; you must have sufficient access privileges to manipulate the file contents. Prior to MySQL 8.0.17, the umask is 0666 and the file is writable by all users on the server host. If the  secure_file_priv  system variable is set to a nonempty directory name, the file to be written must be located in that directory. In the context of  SELECT ... INTO  statements that occur as part of events executed by the Event Scheduler, diagnostics messages (not only errors, but also warnings) are written to the error log, and, on Windows, to the application event log. For additional information, see Section 25.4.5, “Event Scheduler Status” . As of MySQL 8.0.22, support is provided for periodic synchronization of output files written to by  SELECT INTO OUTFILE  and  SELECT INTO DUMPFILE , enabled by setting the  select_into_disk_sync server system variable introduced in that version. Output buffer size and optional delay can be set using, respectively,  select_into_buffer_size  and  select_into_disk_sync_delay . For more information, see the descriptions of these system variables. MySQL supports the following  JOIN  syntax for the  table_references  part of  SELECT  statements and multiple-table  DELETE  and  UPDATE  statements: 13.2.10.2 JOIN Clause table_references: escaped_table_reference  [,  escaped_table_reference ] ... escaped_table_reference : { table_reference | { OJ  table_reference  } } table_reference : { table_factor |  joined_table } table_factor : { tbl_name  [PARTITION ( partition_names )] [[AS]  alias ] [ index_hint_list ] | [LATERAL]  table_subquery  [AS]  alias  [( col_list )] | (  table_references  ) } joined_table : { table_reference  {[INNER | CROSS] JOIN | STRAIGHT_JOIN}  table_factor  [ join_specification ] |  table_reference  {LEFT|RIGHT} [OUTER] JOIN  table_reference join_specification |  table_reference  NATURAL [INNER | {LEFT|RIGHT} [OUTER]] JOIN  table_factor } join_specification : { ON  search_condition | USING ( join_column_list ) } join_column_list : column_name  [,  column_name ] ... index_hint_list : index_hint  [,  index_hint ] ... index_hint : { USE {INDEX|KEY} [FOR {JOIN|ORDER BY|GROUP BY}] ([ index_list ]) 2671