How should I tackle --secure-file-priv in MySQL?

前端 未结 21 1529
攒了一身酷
攒了一身酷 2020-11-22 06:04

I am learning MySQL and tried using a LOAD DATA clause. When I used it as below:

LOAD DATA INFILE \"text.txt\" INTO table mytable;
21条回答
  •  醉梦人生
    2020-11-22 06:16

    For MacOS Mojave running MySQL 5.6.23 I had this problem with writing files, but not loading them. (Not seen with previous versions of Mac OS). As most of the answers to this question have been for other systems, I thought I would post the my.cnf file that cured this (and a socket problems too) in case it is of help to other Mac users. This is /etc/my.cnf

    [client]
    default-character-set=utf8
    
    [mysqld]
    character-set-server=utf8
    secure-file-priv = ""
    skip-external-locking
    

    (The internationalization is irrelevant to the question.)

    Nothing else required. Just turn the MySQL server off and then on again in Preferences (we are talking Mac) for this to take.

提交回复
热议问题