想在mysql裏導入和導出數據,由於navicat在萬條以上數據導出時有機率會出現卡死,重啓的情況,全部只能採用命令窗口裏操做,可是蒼天沒饒過我mysql
在mysql shell裏面導入和導出時提示如下錯誤linux
The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
複製代碼
別慌,咱們能贏,在百度了諸多方案,在被像皮球同樣踢來踢去中,我!終於找到了解決方案。下面開始:sql
show global variables like '%secure%';
複製代碼
看到以下 shell
找到my.ini(我是windows.linux或者其餘可能時my.conf)文件,新增一條windows
secure_file_priv=
複製代碼
記住,等於後後面別加東西比較穩 4.執行語句bash
select * into outfile 'C:\aaa.xlsx' FROM table1 WHERE name is null;
複製代碼