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路徑確實(shí)沒問題,而且目錄和目錄下所有文件都是777權(quán)限,上層目錄也有rx權(quán)限,只不過datadir和下屬文件owner都是root(因為我用虛擬機(jī)掛載的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)文章
/var/log/pacct文件導(dǎo)致MySQL啟動失敗的案例分享
這篇文章主要介紹了/var/log/pacct文件導(dǎo)致MySQL啟動失敗的案例分享,這是個比較讓人郁悶的問題,找不到MySQL啟動失敗的原因進(jìn)可以按此文的方法試一試,需要的朋友可以參考下2015-01-01
MySQL創(chuàng)建數(shù)據(jù)庫和創(chuàng)建數(shù)據(jù)表
MySQL?是最常用的數(shù)據(jù)庫,在數(shù)據(jù)庫操作中,基本都是增刪改查操作,簡稱CRUD。但是,這篇文章主要介紹了數(shù)據(jù)庫和數(shù)據(jù)表如何創(chuàng)建,想詳細(xì)了解的小伙伴可以參考閱讀一下2023-03-03
Mysql 實(shí)現(xiàn)向上遞歸查找父節(jié)點(diǎn)并返回樹結(jié)構(gòu)的示例代碼
通過mysql 8.0以下版本實(shí)現(xiàn),一個人多角色id,一個角色對應(yīng)某個節(jié)點(diǎn)menu_id,根節(jié)點(diǎn)的父節(jié)點(diǎn)存儲為NULL, 向上遞歸查找父節(jié)點(diǎn)并返回樹結(jié)構(gòu),今天通過本文給大家介紹Mysql遞歸查找父節(jié)點(diǎn)并返回樹結(jié)構(gòu),感興趣的朋友一起看看吧2022-09-09

