我在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
文件时我的设置不起作用?
我还可以将两个文件用作配置文件吗?
我找到了使用“如何为mysql添加额外的配置文件(my.cnf)”的替代方法
我包含!include /usr/etc/my.cnf
在我的/ etc / my,cnf文件中,并且可以正常工作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句