Solve the problem of secure_file_priv null

Solve the problem of secure_file_priv null

Add secure_file_priv = ' '; then run cmd as an administrator,

Enter mysql/bin to stop the mysql service net stop mysql, and restart the mysql service net start mysql.

log in

mysql mysql -u root -p enter password: password

Run the show variables like '%secure%'; command to view the value of secure_file_priv .

Note: secure_file_priv is used to set the location where load data can be imported and exported.

Supplement: The problem that secure_file_priv does not take effect in the MYSQL configuration file my.ini.

MYSQL modifies the export file address settings into three types

secure_file_priv is NULL to prohibit the export of files secure_file_priv=""

secure_file_priv specifies the address to restrict the export address to this address only secure_file_priv=“D:/”

secure_file_priv is empty and can be exported to any file secure_file_priv=

This configuration can only be modified in my.ini.

Previously, I encountered a situation where changing secure_file_priv= in my.ini to various formats did not work.

I was entangled for a night, and after researching, I found the solution

Administrator CMD enters the DOS command interface

Type mysql --help to view the limited folders where mysql reads files.

Move the modified my.ini file to one of the folders.

net stop mysql,net start mysql restart service, after logging in show variables like “%secure%”; you can see success

Supplement: Solve the problem that the MySQL configuration file my.ini does not work

First you need to know which my.ini you are running.

Most my.ini files are located in the root directory of the MySQL installation directory.

Check which folder's configuration file is started under your MySQL service in the service

As shown in the figure, go to the correct directory to find the run file.

There are two solutions after finding it:

I recommend the second one, which is simple and rough.

1. Change the path in the above picture to your own my.ini path. (You should modify it in the registry)

2. Find the file directly in the directory in the picture above, copy your configuration file to the directory or modify it directly in it.

(The ProgramData folder is hidden by default, just check Show hidden folders in Folder Options)

The above is my personal experience. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM. If there are any mistakes or incomplete considerations, please feel free to correct me.

You may also be interested in:
  • Solution to secure-file-priv problem when exporting MySQL data
  • MySQL online log library migration example
  • How to clean up data in MySQL online database
  • How to create a table in mysql and add field comments
  • Optimized implementation of count() for large MySQL tables
  • Introduction to the use of MySQL source command
  • Causes and solutions for MySQL too many connections error

<<:  Echarts implements switching different X-axes in one graph (example code)

>>:  Shell script builds Docker semi-automatic compilation, packaging and release application operations

Recommend

Specific implementation methods of MySQL table sharding and partitioning

Vertical table Vertical table splitting means spl...

Optimization methods when Mysql occupies too high CPU (must read)

When Mysql occupies too much CPU, where should we...

Nodejs-cluster module knowledge points summary and example usage

The interviewer will sometimes ask you, tell me h...

How to install WSL2 Ubuntu20.04 on Windows 10 and set up the docker environment

Enable WSL Make sure the system is Windows 10 200...

JS implements simple calendar effect

This article shares the specific code of JS to ac...

Server concurrency estimation formula and calculation method

Recently, I need to stress test the server again....

iview implements dynamic form and custom verification time period overlap

Dynamically adding form items iview's dynamic...

A comprehensive summary of frequently used statements in MySQL (must read)

The knowledge points summarized below are all fre...

Example code for css flex layout with automatic line wrapping

To create a flex container, simply add a display:...

How to use Volume to transfer files between host and Docker container

I have previously written an article about file t...

How to compile and install opencv under ubuntu

Easy installation of opencv2: conda install --cha...

Echarts Basic Introduction: General Configuration of Bar Chart and Line Chart

1Basic steps of echarts Four Steps 1 Find the DOM...

Manually implement js SMS verification code input box

Preface This article records a common SMS verific...

A brief analysis of event bubbling and event capture in js

Table of contents 01-Event Bubbling 1.1- Introduc...

jQuery realizes dynamic particle effect

This article shares the specific code of jQuery t...