Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MYSQL new feature secure_file_priv read and write file o

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1290-The MySQL server is running with the-secure-file-priv option so it cannot execute this statement

Secure-file-priv characteristics

The secure-file-priv parameter is used to restrict LOAD DATA, SELECT... OUTFILE, and LOAD_FILE () to which specified directory.

The value of ure_file_priv is null, which means that mysqld is not allowed to import | Export when the value of secure_file_priv is / tmp/, it means to restrict the import of mysqld | Export can only occur in the / tmp/ directory. When the value of secure_file_priv has no specific value, it means that the import of mysqld is not restricted. | Export is not restricted.

How to view the value of the secure-file-priv parameter:

Show global variables like'% secure%'

No export permission: mysql > show global variables like'% secure%' +-+-+ | Variable_name | Value | +-+-+ | secure_auth | OFF | | secure_file_priv | | +-+-+ 2 rows in set (0.00 sec)

You have export permission. The export path needs to be under / var/lib/mysql-files/:

Mysql > show global variables like'% secure%' +-- +-- + | Variable_name | Value | +-- +-- -+ | require_secure_transport | OFF | | secure_auth | ON | | secure_file_priv | / var/lib/mysql-files/ | +-- +-- + 3 rows in set (0.09 sec)

The influence of secure_file_priv, a new feature of MYSQL, on reading and writing files

This switch defaults to NULL, that is, import and export are not allowed.

Resolve the problem:

Under windows:

Modify my.ini and add secure_file_priv= in [mysqld]

Under linux:

Modify my.cnf and add secure_file_priv= in [mysqld]

The influence of secure_file_priv, a new feature of MYSQL, on reading and writing files

Then restart mysql and query secure_file_priv

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report