How to solve the problem of mysqlimport:error:13, can ' t get stat of _mysql

Source: Internet
Author: User
Today, when looking at the MySQL user's manual, I saw a very strange problem with the operation of the mysqlimport where the backup was restored.
Copy Code code as follows:

root@zhou:/usr/local/mysql# mysqlimport-uroot-p123-h127.0.0.1-p3306 Test Backup/chen.sql
Mysqlimport:error:13, Can ' t get stat of '/usr/local/mysql/data/backup/chen.sql ' (errcode:2), when using Table:chen

The reason for this error is queried here through Perror:
Copy Code code as follows:

root@zhou:/usr/local/mysql# perror 13
root@zhou:/usr/local/mysql# LL
OS error code 13:permission denied

Copy Code code as follows:

<span style= "font-size:10px" > But here I look at my permission is no problem. My backup files are in the backup document </SPAN>

Copy Code code as follows:

Total Dosage 120
Drwxr-xr-x root mysql 4096 January 10 19:02./
Drwxr-xr-x root 4096 January 8 11:34. /
Drwxr-xr-x 2 mysql mysql 4096 January 17:30 backup/
Drwxr-xr-x 2 root mysql 4096 January 8 10:39 bin/

Copy Code code as follows:

<span style= "font-size:10px" > Here I solve the problem of the way and the process is like this, first Google and Baidu under, see if you can fix such a problem. I then use the load data infile to see if there are any problems (the load command is the same command). </SPAN>

Through Google and Baidu did not find the answer I want, and I was in the load data infile operation, found no problem, so the summary here should not be the issue of permissions:
Copy Code code as follows:

MySQL (root@localhost:test) >load data infile '/usr/local/mysql/backup/chen.sql ' into table Chen;
Query OK, 6 rows affected (0.07 sec)
Records:6 deleted:0 skipped:0 warnings:0

Copy Code code as follows:

<span style= "font-size:10px" > finally through the man query the issue of this command, will find an image is the--local command of the problem </SPAN>

Copy Code code as follows:

root@zhou:/usr/local/mysql# mysqlimport-uroot-p123-h127.0.0.1-p3306 Test Backup/chen.sql
Mysqlimport:error:13, Can ' t get stat of '/usr/local/mysql/data/backup/chen.sql ' (errcode:2), when using Table:chen
root@zhou:/usr/local/mysql# mysqlimport-uroot-p123-h127.0.0.1-p3306 Test Backup/chen.sql--local
Test.chen:records:6 deleted:0 skipped:0 warnings:0

Copy Code code as follows:

<span style= "font-size:10px" > so the problem is solved, here our--local role is </SPAN>

Specifies that the data file be read from the client computer, otherwise read from the server computer
So here's where the problem lies. --local

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.