无法找到MySQL数据目录:my.cnf不包含基本设置

时间:2016-09-20 15:57:55

标签: mysql

我试图按照https://www.mkyong.com/mysql/where-does-mysql-stored-the-data-in-my-harddisk/上的说明操作。我在示例中找到了my.cnf中的etc/mysql文件,但令我惊讶的是它并不包含任何基本设置,只有以下内容:

# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

我还希望使用user =datadir =等行。是不是MySQL设置不正确?

1 个答案:

答案 0 :(得分:0)

Marc B发表评论之后,我做了一些搜索,发现在Askubuntu上回答了同样的问题:https://askubuntu.com/questions/699903/why-etc-mysql-my-cnf-is-empty

重申一下,includedir行表示可以在列出的目录中找到其他配置文件(在这种情况下为.cnf)。