我正在尝试将数据加载到MariaDB数据库中。加载目录的所有权修改如下:
$ chown -R mysql load_data
目录的权限显示为:
drwxrwxr-x 2 mysql beta_user 4096 Jul 20 16:33 load_data
数据文件 emp_list.dat ,如下所示:
Dineen,,Tim,Frog,1965-03-17
Blatter,,Greg,Butterfly,1975-10-18
Hank,Larry,Kevin,Aligator,1980-02-03
Jones,,Tom,Singer,1945-04-04
load_employees.sql 中的加载命令如下:
load data infile
'/home/beta_user/sample_code/db/mariadb/load_data/emp_list.dat'
into table pktest.employees
fields terminated by ','
optionally enclosed by '"'
lines terminated by '\n'
(last_name,middle_name,first_name,pref_name,@dob)
set dob = str_to_date(@dob, '%y-%m-%d');
当我尝试加载数据时,会出现以下错误:
$ mysql --defaults-file =〜/ bin / msqlpsw / msqlpkpsw.dat -D pktest -e" source /home/beta_user/sample_code/db/mariadb/load_data/load_employees.sql" 错误13(HY000)在文件的第1行:' /home/beta_user/sample_code/db/mariadb/load_data/load_employees.sql': 无法获取' /home/beta_user/sample_code/db/mariadb/load_data/emp_list.dat'的统计信息。 (错误代码:13"权限被拒绝")
有人可以建议为什么错误,因为目录的所有权设置为mysql?