Unable to create / write to file - Error code 13 on Linux

I am trying to create a mysql table on Linux with changing the data directory to another location. The forward selected has full resolution. But I got the error "Unable to create / write to file." I googled and found that this error is related to the allowed resolution. I can change the permission of the folder owner to root using the chown command. But he still shows the same error.

mysql> create table test_table( testId int PRIMARY KEY, testName VARCHAR(20) ) DATA DIRECTORY = '/home/Test/Sample/data'; ERROR 1 (HY000): Can't create/write to file '/home/Test/Sample/data/test_table1.MYD' (Errcode: 13) 

What can I do??? Please give me some valuable suggestions ...

+6
source share
1 answer
 mysql> create table test_table( testId int PRIMARY KEY, testName VARCHAR(20) ) DATA DIRECTORY = '/home/Test/Sample/data'; 

Write how:

 mysql> create table test_table( testId int PRIMARY KEY, testName VARCHAR(20) ) DATA DIRECTORY = '/tmp/data'; 

To simplify your life, try saving to the '/ tmp' directory, since mysql has access to this directory, and not swaying with (chown) ownership change.

+8
source

Source: https://habr.com/ru/post/926275/


All Articles