Obtain MySQL permissions for files and folders in Linux (SELinux)
Obtain MySQL permissions for files and folders in Linux (SELinux)
Homepage → Database Technology
Background:
Read News
Obtain MySQL permissions for files and folders in Linux (SELinux)
[Date: 2012-11-22] Source: Linux Author: chencong112 [Font:]
Move the MySQL database directory on Linux today
The configuration is as follows:
/Etc/my. cnf
[Mysqld]
Datadir =/home/mysql
Socket =/var/lib/mysql. sock
The following problems occur when the configuration file is changed and MYSQL is restarted:
110222 11:15:07 mysqld_safe Starting mysqld daemon with databases from/home/mysql
110222 11:15:07 [Warning] Can't create test file/home/mysql/localhost. lower-test
110222 11:15:07 [Warning] Can't create test file/home/mysql/localhost. lower-test
/Usr/libexec/mysqld: Can't find file: './mysql/plugin. frm' (errno: 13)
110222 11:15:07 [ERROR] Can't open the mysql. plugin table. Please run mysql_upgrade to create it.
110222 11:15:07 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights
InnoDB: the directory.
InnoDB: File name./ibdata1
InnoDB: File operation call: 'Open '.
InnoDB: Cannot continue operation.
110222 11:15:07 mysqld_safe mysqld from pid file/var/run/mysqld. pid ended
I thought it was just a file or folder permission problem. I changed all the corresponding directory and file permissions to read/write status... it is still useless...
After searching for a while on the internet, I found a solution ~
The solution is as follows:
# Enter the following line in the terminal
Chown-R mysql: mysql/home/data/mysql
# Enter the following line and it will be OK.
Chcon-R-t mysqld_db_t/home/mysql
# Try restarting MYSQL ~
/Etc/init. d/mysqld restart
0
PL/SQL cannot connect to the Oracle database
High-performance data creation using MySQL triggers
SELinux Linux SELinux
Image Information
View All comments in this article (0)
Comments
Latest Information
Popular this week
Introduction to Linux community-advertisement service-website map-help Info-contact us
The articles published on this site (LinuxIDC) do not mean that they agree with the statement or description. They only provide more information and do not constitute any suggestions.
Copyright©2006-2014 Linux community All rights reserved Zhejiang ICP backup No. 06018118
,