首页 > 解决方案 > 来自 aws ec2 的文件 /etc/mysql/mysql.conf.d 不存在

问题描述

除此之外,我试图在 aws ec2 中找到类似标题的文件,但它不存在。我想我在不知情的情况下删除了它。当文件不存在时,还有其他解决方案吗?重新安装被认为是最后的手段。

标签: mysqlamazon-web-servicesamazon-ec2

解决方案


我觉得你是男人,我真的很讨厌成为那个人,但这就是我们需要备份的原因。话虽如此,您可以手动重新创建目录并添加一个mysql.cnf内部。通常,它只包含 mysql 配置的占位符部分以及一些许可证文本。

# Copyright (c) 2015, 2021, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation.  The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# 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, version 2.0, 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

#
# The MySQL  Client configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysql]

我不知道您的配置文件中还有什么,但如果您有自定义设置,您也可以手动添加它们。

通常还有一个mysqldump.cnf里面conf.d有以下内容

[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

推荐阅读