
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can we tackle MySQL error āERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statementā while importing or exporting the data?
MySQL throws this error because of the two reasons, either no directory is specified under --secure--file--priv variable or we are giving the wrong path in our query while importing or exporting the data. To tackle this error we must have to check the value of –secure—file—priv variable by following query −
mysql> Select @@global.secure_file_priv; +---------------------------+ | @@global.secure_file_priv | +---------------------------+ | C:\mysql\bin\mysql-files\ | +---------------------------+ 1 row in set (0.00 sec)
We can see there is path under secure_file_priv variable and all the files would be created under this directory when we export the data.
But, if the above command shows NULL as result then it means there is no path specified and we need to specify the path in my.ini file before exporting the data. Suppose if we will write secure_file_priv = mysql-files/ in our my.ini file then secure_file_priv will have the path like above as its value. Then all the files will be created under this directory.
- Related Articles
- Can we know the last MySQL error?
- How can we MySQL LOAD DATA INFILE statement with āENCLOSED BYā option to import data from text file into MySQL table?
- MySQL Error ERROR 1099 (HY000): Table was locked with a READ lock and can't be updated
- How can we MySQL LOAD DATA INFILE statement with āFIELDS TERMINATED BYā option to import data from text file into MySQL table?
- Fix: ERROR 1396 (HY000): Operation CREATE USER failed in MySQL?
- What is the use of escape character () in text file while importing the data from text file to MySQL table?
- comp_err - Compile MySQL Error Message File
- What is the MySQL error: āData too long for columnā?
- How MySQL evaluates if we use any other escape character rather that back-slash () in a text file while importing the data from text file to MySQL table?
- Importing/Exporting ABAP packages to Presentation server
- Fix ERROR 1093 (HY000): You can't specify target table for update in FROM clause while deleting the lowest value from a MySQL column?
- Importing / Exporting CSV file in PowerShell
- How MySQL evaluates the blank line between two lines written in the text file while importing that text file into MySQL table?
- How can we upload the changed value, rather than written in a text file, of column(s) while importing that text file into MySQL table?
- What is the MySQL syntax error in this query ā Creating a table with reserved keyword?
