centos6.2, stop mysqld and then modify/ETC/MY.CNF datadir location, start mysqld prompt failed, view log
Copy Code code as follows:
120609 11:31:31 mysqld_safe mysqld from PID File/var/run/mysqld/mysqld.pid ended
120609 11:35:12 Mysqld_safe starting mysqld daemon with databases From/mnt/hgfs/mysql_data
120609 11:35:13 [Warning] Can ' t create test file/mnt/hgfs/mysql_data/data.lower-test
120609 11:35:13 [Warning] Can ' t create test file/mnt/hgfs/mysql_data/data.lower-test
/usr/libexec/mysqld:can ' t change dir to '/mnt/hgfs/mysql_data/' (errcode:13)
120609 11:35:13 [ERROR] Aborting
120609 11:35:13 [note]/usr/libexec/mysqld:shutdown complete
120609 11:35:13 mysqld_safe mysqld from PID File/var/run/mysqld/mysqld.pid ended
The new datadir path is fine, and all files in the directory and directory are 777 permissions, and the upper directory has RX permissions, except that DataDir and subordinate files owner are root (because I use a virtual machine to mount the file system of Windows). Later thought should be the ghost of SELinux, set to permissive mode after normal start mysqld.
Copy Code code as follows:
[Root@data selinux]# Getenforce
Enforcing
[Root@data selinux]# Setenforce 0
[Root@data selinux]# Getenforce
Permissive
Setenforce 1 set SELinux to become enforcing mode
Setenforce 0 Set SELinux to become permissive mode
Completely closed, Vi/etc/selinux/config modified selinux=disabled
Copy Code code as follows:
# This file controls the ' state of ' SELinux on the system.
# selinux= can take one of these three values:
# Enforcing-selinux security policy is enforced.
# Permissive-selinux Prints warnings instead of enforcing.
# disabled-no SELinux policy is loaded.
Selinux=disabled
# selinuxtype= can take one of these two values:
# targeted-targeted processes are protected,
# Mls-multi level security protection.
selinuxtype=targeted