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

How to solve the problem of Database error reporting ERROR 1290

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to solve the problem of database error reporting ERROR 1290". In daily operation, I believe many people have doubts about how to solve the problem of database error reporting ERROR 1290. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "how to solve the problem of database error reporting ERROR 1290". Next, please follow the editor to study!

The following error occurred when exporting data using SELECT...INTO OUTPUT:

Root@localhost [team] > select * from team.player into outfile "/ tmp/sql/player.txt"

ERROR 1290 (HY000): The MySQL server is running with the-- secure-file-priv option so it cannot execute this statement

Through the error prompt, you can find that it is caused by the setting of the secure-file-priv variable. Check the setting of this variable. The default path is / var/lib/mysql-files/.

Root@localhost [team] > show 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.01sec)

Description:

Secure_file_prive=null restricts mysqld does not allow import and export

Secure_file_priv=/var/lib/mysql-files/ restricts the import and export of mysqld to occur only in the / var/lib/mysql-files/ directory

Secure_file_priv=' 'does not restrict the import and export of mysqld

Solution:

Modify the value of secure_file_prive or export according to the default path

Under windows, add secure_file_priv='', under the my.ini file [mysqld] node and restart the mysql service. Add secure_file_priv='' to / etc/my.cnf under linux.

1. I choose the former to modify the default path

[root@seiang mysql] # vim / etc/my.cnf

[mysqld]

Secure_file_priv=''

2. Restart the mysql service

[root@seiang mysql] # systemctl restart mysqld.service

3. Check the value of the variable NULL again.

Root@localhost [team] > show variables like'% secure%'

ERROR 2006 (HY000): MySQL server has gone away

No connection. Trying to reconnect...

Connection id: 2

Current database: team

+-+ +

| | Variable_name | Value |

+-+ +

| | require_secure_transport | OFF |

| | secure_auth | ON |

| | secure_file_priv |

+-+ +

3 rows in set (0.13 sec)

4. Execute the export operation again, which is successful

Root@localhost [team] > select * from team.player into outfile "/ tmp/player.txt"

Query OK, 3 rows affected (0.00 sec)

At this point, the study on "how to solve the problem of database error reporting ERROR 1290" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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