Today by statement: SELECT * FROM mytable to outfile ' D:/mytable.xls '; Export external files, but anyway unsuccessful, the system prompts: the MySQL server is running with the--SECURE-FILE-PRIV option so it cannot execute this state ment when executing ' SELECT into OUTFILE ';
So, by entering the command: show variables like '%secure% '; Query variable: The value of Secure_file_priv was found to be NULL;
- Restrict mysqld import when Secure_file_prive=null is not allowed | Export
- Restrict import of mysqld when secure_file_priv=/tmp/| Export can only occur in the/tmp/directory
- Do not mysqld Import | Export to do the restriction is: secure_file_prive=;
- So in the MySQL installation directory, locate the My.ini file, open it by Notepad, search [mysqld], enter under [mysqld]: Secure_file_priv = can
- Finally restart the MySQL service, how to restart the Windows service: Win+r Open the Run window, enter services.msc, the Windows Services window today. Find the MySQL service, select it, and click ' Restart '.
- Reopen MySQL command line Client. Enter the command to
MySQL import and export files encountered problems