Preface When mysql modified the default database path, the service could not be started. After checking the log, it was found that there was an error in the file permission. For the changed directory, mysql has been set as the owner of the directory! And everything is normal if you start the database directly from the command line. I used the almighty Google and finally found the reason in a post from a foreigner - SELINUX policy issue! All background services need to have corresponding permissions for the corresponding directories, and the default path of mysql /var/lib/mysql has added corresponding policies. After the path is modified, due to the lack of corresponding policies, the background process is blocked from reading files by selinux, resulting in permission errors! Here’s how: mysql, the method is: chcon -R -t mysqld_db_t /db/mysql If it is APACHE, the method is: # chcon -R -h -t httpd_sys_content_t /www/web/ Attached chcon command help
Command format:
illustrate: CONTEXT is the security context to be set FILES Object (Files) --reference reference object PEF_FILES Refer to file context The FILES application refers to the files context as my context. OPTIONS are as follows: -f Force execution -R Recursively modify the security context of an object -r ROLE Modify the configuration of the security context role -t TYPE Modify the configuration of the security context type -u USER Modify the configuration of the security context user -v displays verbose information -l, --range=RANGE Change the security level in the security context mysql, the method is: chcon -R -t mysqld_db_t /db/mysql Examples If you want to share this ftp to anonymous users, you need to enable the following: chcon -R -t public_content_t /var/ftp If you want to allow uploading files to the FTP directory you set, SELINUX needs to be set: chcon -t public_content_rw_t /var/ftp/incoming Allow users to access their home directory via HTTP. This setting is limited to the user's home directory home page: setsebool -P httpd_enable_homedirs 1 chcon -R -t httpd_sys_content_t ~user/public_html If you want to share the samba directory with other users, you need to set: chcon -t samba_share_t /directory When sharing the rsync directory: chcon -t public_content_t /directories Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM. You may also be interested in:
|
<<: The best way to automatically mount shared directories on Ubuntu 16.04 startup under Virtualbox
>>: vue+springboot realizes login verification code
Table of contents Summarize Sometimes we need to ...
MySQL Users and Privileges In MySQL, there is a d...
This article describes how to enable https servic...
Table of contents Preface difficulty Cross-domain...
Copy code The code is as follows: a:link { font-s...
A transaction is a logical group of operations. E...
1. Dynamic Components <!DOCTYPE html> <h...
ElementUI implements a table tree list loading tu...
Copy code The code is as follows: <!DOCTYPE ht...
Table of contents Isolate Data Columns Prefix Ind...
1. Cancel the blue color of the a tag when it is ...
About a year ago, I wrote an article: Analysis of...
MYSQL version: MySQL Community Server 5.7.17, ins...
Basic syntax You can create a view using the CREA...
1. Introduction Image maps allow you to designate...