When reading the mysql user manual, I saw the mysqlimport command for Backup recovery, and a strange problem occurred after the operation.
Copy codeThe Code is 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
Here, perror is used to query the cause of this error:
Copy codeThe Code is as follows:
Root @ zhou:/usr/local/mysql # perror 13
Root @ zhou:/usr/local/mysql # ll
OS error code 13: Permission denied
Copy codeThe Code is as follows:
<SPAN style = "FONT-SIZE: 10px"> however, I can check my permissions here. My backup files are in the backup document. </SPAN>
Copy codeThe Code is as follows:
Total usage 120
Drwxr-xr-x 17 root mysql 4096 January 10 19:02 ./
Drwxr-xr-x 22 root 4096 January 8 11:34 ../
Drwxr-xr-x 2 mysql 4096 January 10 17:30 backup/
Drwxr-xr-x 2 root mysql 4096 January 8 10:39 bin/
Copy codeThe Code is as follows:
<SPAN style = "FONT-SIZE: 10px"> here, my solution and process are like this. First, google and Baidu will check whether the problem can be solved. Then I am using load data infile to see if this problem will also occur (the load command here is the same command ). </SPAN>
Google and Baidu didn't find the answer they wanted, but I found no problem during the load data infile operation. So the conclusion here should not be the permission problem:
Copy codeThe Code is 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 codeThe Code is as follows:
<SPAN style = "FONT-SIZE: 10px"> when you use man to query the command, you will find an imaginary problem: the local command. </SPAN>
Copy codeThe Code is 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 codeThe Code is as follows:
<SPAN style = "FONT-SIZE: 10px"> here, our -- local function is to solve this problem. </SPAN>
Specify to read data files from the client computer; otherwise, read data from the server computer.
So the problem is found here. -- Local