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 mysql-can't get stat of (errcode:13)

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is mainly about "how to solve the problem of mysql-can't get stat of (errcode:13)". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to solve the problem of mysql-can't get stat of (errcode:13).

Today, when importing data, the following error occurred:

Mysql > load data infile'/ root/aaa' into table test fields terminated by', 'lines terminated by'\ n'

Mysql > ERROR 13 (HY000): Can't get stat of'/ root/aaa' (Errcode: 13)

At first, I thought it was the right of the / root/aaa file or the root user of mysql, but later I thought it was wrong. The root user of mysql is a super user and must have rights, so the problem lies in the permissions of the / root/aaa file. Later, I changed the permissions of / root/aaa to 777, which still won't work after performing the operation.

Hehe, it turns out that it is the permission of the file directory where the aaa file is located. This is easy to do. Switch to / tmp/aaa and perform the above operations to see:

Mysql > load data infile'/ tmp/aaa' into table users_groups fields terminated by', 'lines terminated by'\ n'

Query OK, 14 rows affected (0.01sec)

Records: 14 Deleted: 0 Skipped: 0 Warnings: 0

Ok, it worked!

The reason for using the / tmp directory is that mysql uses / tmp as a temporary read-write directory by default.

Mysql > show variables like'% tmpdir%'

+-+ +

| | Variable_name | Value |

+-+ +

| | slave_load_tmpdir | / tmp |

| | tmpdir | / tmp |

+-+ +

2 rows in set (0.00 sec)

At this point, I believe you have a deeper understanding of "how to solve the problem of mysql-can't get stat of (errcode:13)". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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