Mysql modification DataDir cause failed to start problem resolution _MYSQL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.