• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue LOAD DATA INFILE Can't get stat of (Errcode: 13)

eco1999

New Pleskian
I started to use Plesk panel on Linux vds and getting this error when I am trying to load data. Collect folder permission is 777. I don't know how can I solve it.

LOAD DATA INFILE '/var/www/vhosts/folder/httpdocs/modules/admin/collect/collect_4588ov1qidu.csv' INTO TABLE messages FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n'

#13 - Can't get stat of '/var/www/vhosts/folder/httpdocs/modules/admin/collect/collect_4588ov1qidu.csv' (Errcode: 13)

I tried LOCAL word too but it gives me LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile
 
- Make sure that the file name is spelled correctly including capitalization and that the path really exists. E.g. is the o really an o or an O or a 0?
- Move the file into a directory where the database can access files for sure, e.g. /tmp, and retry the import from that location
 
- Make sure that the file name is spelled correctly including capitalization and that the path really exists. E.g. is the o really an o or an O or a 0?
- Move the file into a directory where the database can access files for sure, e.g. /tmp, and retry the import from that location
- I took the path from FileZilla. All seems correct.
- Do you think the database cannot reach here?
 
Yes, obviously the file or the directory has permissions that are too restrictive to import it. You can either move it into /tmp or another directory where your database has access or you can check the file permissions, e.g.
# ll /var/www/vhosts/folder/httpdocs/modules/admin/collect/collect_4588ov1qidu.csv
and make appropriate changes like
# chmod 0755 /var/www/vhosts/folder/httpdocs/modules/admin/collect/collect_4588ov1qidu.csv
to make that file accessible for the database.
 
Yes, obviously the file or the directory has permissions that are too restrictive to import it. You can either move it into /tmp or another directory where your database has access or you can check the file permissions, e.g.
# ll /var/www/vhosts/folder/httpdocs/modules/admin/collect/collect_4588ov1qidu.csv
and make appropriate changes like
# chmod 0755 /var/www/vhosts/folder/httpdocs/modules/admin/collect/collect_4588ov1qidu.csv
to make that file accessible for the database.
I moved the file to /tmp directory and it gives me "#13 - Can't get stat of '/tmp/collect_4588ov1qidu.csv' (Errcode: 2)"
 
If the file is located in a generally accessible directory and has 0755 permissions, one cause for a permission issue can be a security setting. Are you using selinux for example? Some also say you'll need load data local infile instead of load data infile. Maybe check this here:
 
If the file is located in a generally accessible directory and has 0755 permissions, one cause for a permission issue can be a security setting. Are you using selinux for example? Some also say you'll need load data local infile instead of load data infile. Maybe check this here:
It's Centos 7. I tried local but it gives me as I said before this; "LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile"
 
I am a bit irritated, because mysqli.allow_local_infile is a PHP setting.

Try to add these into the corresponding sections of /etc/my.cnf, then restart mariadb, then try import again:
Code:
[mysql]
local-infile=1

[mysqld]
local-infile=1
 
I am a bit irritated, because mysqli.allow_local_infile is a PHP setting.

Try to add these into the corresponding sections of /etc/my.cnf, then restart mariadb, then try import again:
Code:
[mysql]
local-infile=1

[mysqld]
local-infile=1
I tried before to edit that file on FileZilla but it didn't let me upload the edited file to the server.

/etc/my.cnf: open for write: permission denied
 
You need to edit it on the Linux console. You cannot edit it through FTP, because the file is owned by another (system) user and does not have write permissions for others.
 
You need to edit it on the Linux console. You cannot edit it through FTP, because the file is owned by another (system) user and does not have write permissions for others.
[mysqld]
bind-address = ::
local-infile=1
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in This page has moved

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

[mysql]
local-infile=1

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
I am still getting the same error although I have edited it.
 
If the file is located in a generally accessible directory and has 0755 permissions, one cause for a permission issue can be a security setting. Are you using selinux for example? Some also say you'll need load data local infile instead of load data infile. Maybe check this here:
Thank you Sir for sharing this information. I am new to this forum and this information really help me...
 
Back
Top