mysql creates database error (errno13)

When a new database is created in the database on centos, it is found that it cannot be created and an error is reported (errno 13)

I checked a lot of information, the error code 13 is a permission problem, and most people recommend viewing the permissions of the database data files. Some people are as follows

drwxr-xr-x. 7 root root 181 3月  15 10:51 mysql

In this case, you can use the command  chown -R mysql:mysql mysql to solve

My database file is already mysql operable as follows

drwxr-xr-x. 7 mysql mysql 181 March 15 10:51 mysql

After a lot of research, I finally found the reason and solution:

The security mechanism of SELinux linux can be solved by turning it off

setenforce 0 

This method can only be temporarily closed when the system restarts and it will fail again.

Open the selinux configuration file

[root@localhost ~]# vim /etc/selinux/config

Modify the selinux configuration file

Change SELINUX=enforcing to SELINUX=disabled, save and exit

reboot the system

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326019493&siteId=291194637