《MYSQL數(shù)據(jù)庫(kù)Mysql修改datadir導(dǎo)致無(wú)法啟動(dòng)問(wèn)題解決方法》要點(diǎn):
本文介紹了MYSQL數(shù)據(jù)庫(kù)Mysql修改datadir導(dǎo)致無(wú)法啟動(dòng)問(wèn)題解決方法,希望對(duì)您有用。如果有疑問(wèn),可以聯(lián)系我們。
centos6.2,停止mysqld然后修改/etc/my.cnf datadir的地位,啟動(dòng)mysqld提示FAILED,查看日志
MYSQL數(shù)據(jù)庫(kù)
代碼以下:
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 completeMYSQL數(shù)據(jù)庫(kù)
120609 11:35:13 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
MYSQL數(shù)據(jù)庫(kù)
新的datadir路徑確實(shí)沒(méi)問(wèn)題,并且目錄和目錄下所有文件都是777權(quán)限,上層目錄也有rx權(quán)限,只不過(guò)datadir和下屬文件owner都是root(因?yàn)槲矣锰摂M機(jī)掛載的windows的文件系統(tǒng)).后來(lái)想到應(yīng)該是selinux搞的鬼,設(shè)置為permissive模式之后正常啟動(dòng)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模式MYSQL數(shù)據(jù)庫(kù)
徹底封閉,vi /etc/selinux/config 修改 SELINUX=disabledMYSQL數(shù)據(jù)庫(kù)
代碼以下:
# 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
《MYSQL數(shù)據(jù)庫(kù)Mysql修改datadir導(dǎo)致無(wú)法啟動(dòng)問(wèn)題解決方法》是否對(duì)您有啟發(fā),歡迎查看更多與《MYSQL數(shù)據(jù)庫(kù)Mysql修改datadir導(dǎo)致無(wú)法啟動(dòng)問(wèn)題解決方法》相關(guān)教程,學(xué)精學(xué)透。維易PHP學(xué)院為您提供精彩教程。
轉(zhuǎn)載請(qǐng)注明本頁(yè)網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/13609.html