With the soft connection changed the location of the/var/lib/mysql, and set the Mysql.mysql permissions, but found still cannot start.
Discover/var/log/mysqld.log
150308 16:16:02 [Warning] Can ' t ' Create test File/var/lib/mysql/gadget.lower-test
150308 16:16:02 [Warning] Can ' t ' Create test File/var/lib/mysql/gadget.lower-test
/usr/libexec/mysqld:can ' t change dir to '/var/lib/mysql/' (errcode:13)
Think that should still be some kind of permission problem, after checking the post found
Chcon-t Var_lib_t/home
Chcon-r-T Mysqld_db_t/home/mysql
Reason is
Look at the first time the properties of the/var/lib/mysql directory:
[Email protected] mysql]# Ls-alz
Drwxr-xr-x. MySQL MySQL system_ubject_r:mysqld_db_t:s0.
Drwxr-xr-x. Root root system_ubject_r:var_lib_t:s0.
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 centos6-relay-bin.000001
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 centos6-relay-bin.000002
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 centos6-relay-bin.index
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 ibdata1
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 ib_logfile0
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 ib_logfile1
-RW-RW----. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 master.info
DRWX------. MySQL MySQL unconfined_ubject_r:mysqld_db_t:s0 MySQL
-RW-RW----. MySQL MySQL unconfined_u:object_r:mysqld_db_t:s0 mysqld-relay-bin.000001
-RW-RW----. MySQL MySQL unconfined_u:object_r:mysqld_db_t:s0 mysqld-relay-bin.index
Srwxrwxrwx. MySQL MySQL unconfined_u:object_r:mysqld_var_run_t:s0 mysql.sock
-RW-RW----. MySQL MySQL unconfined_u:object_r:mysqld_db_t:s0 relay-log.info
DRWX------. MySQL MySQL unconfined_u:object_r:mysqld_db_t:s0 test
The SELinux attribute of Discovery/var/lib is var_lib_t
/var/lib/mysql the SELinux attribute for all files below is mysqld_db_t
So these two steps must be executed.
Change the location of MySQL data files on Linux