![](/img/trans.png)
[英]Cannot see any of /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf in my dir
[英]MySQL 5.5.38 not picking option file from /usr/etc/my.cnf
我在Centos 6.4上使用MySQL 5.5.38版本
$ mysql --version
mysql Ver 14.14 Distrib 5.5.38, for Linux (x86_64) using readline 5.1
在幫助中說
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
我的機器上沒有/etc/my.cnf
或/etc/mysql/my.cnf
。
我用以下內容創建了/usr/etc/my.cnf
[mysqld]
default-storage-engine = InnoDB
我重新啟動了mysql服務器。 當我創建一個新表時,它仍然使用MyISAM作為存儲引擎而不是InnoDB
如果我將/etc/my.cnf
用於配置文件,則它將InnoDB用作存儲引擎。
我的問題是為什么使用/usr/etc/my.cnf
文件時我的設置/usr/etc/my.cnf
?
我還可以將兩個文件用作配置文件嗎?
Mysql使用一個配置文件。 如何找到其位置閱讀這里
我找到了使用“ 如何為mysql添加額外的配置文件(my.cnf)”的替代方法
我在/ etc / my,cnf文件中包含!include /usr/etc/my.cnf
,它可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.