Mysql修改datadir導(dǎo)致無法啟動問題解決方法
centos6.2,停止mysqld然后修改/etc/my.cnf datadir的位置,啟動mysqld提示FAILED,查看日志
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
新的datadir路徑確實沒問題,而且目錄和目錄下所有文件都是777權(quán)限,上層目錄也有rx權(quán)限,只不過datadir和下屬文件owner都是root(因為我用虛擬機掛載的windows的文件系統(tǒng))。后來想到應(yīng)該是selinux搞的鬼,設(shè)置為permissive模式之后正常啟動mysqld。
[root@data selinux]# getenforce
Enforcing
[root@data selinux]# setenforce 0
[root@data selinux]# getenforce
Permissive
setenforce 1 設(shè)置SELinux 成為enforcing模式
setenforce 0 設(shè)置SELinux 成為permissive模式
徹底關(guān)閉,vi /etc/selinux/config 修改 SELINUX=disabled
# 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
相關(guān)文章
詳解MySQL和Redis如何保證數(shù)據(jù)一致性
MySQL與Redis都是常用的數(shù)據(jù)存儲和緩存系統(tǒng),為了提高應(yīng)用程序的性能和可伸縮性,很多應(yīng)用程序?qū)ySQL和Redis一起使用,其中MySQL作為主要的持久存儲,而Redis作為主要的緩存,那么本文就給大家介紹一下MySQL和Redis如何保證數(shù)據(jù)一致性,需要的朋友可以參考下2023-08-08MySQL query_cache_type 參數(shù)與使用詳解
這篇文章主要介紹了MySQL query_cache_type參數(shù)介紹,需要的朋友可以參考下2021-07-07JDBC-idea導(dǎo)入mysql連接java的jar包(mac)的方法
這篇文章主要介紹了JDBC-idea導(dǎo)入mysql連接java的jar包(mac)的方法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-09-09MySQL中使用or、in與union all在查詢命令下的效率對比
這篇文章主要介紹了MySQL中使用or、in與union all在查詢命令下的效率對比,論證了在通常情況下union all并不一定比or及in更快,需要的朋友可以參考下2015-11-11