mysqld忽略my.cnf(Ubuntu 16.04服务器上的mysql 5.6)

时间:2021-04-11 23:43:17

I installed mysql 5.6 on Ubuntu Server 16.04 using this method: https://askubuntu.com/questions/762384/install-mysql-5-6-on-ubuntu-16-04

我使用这种方法在Ubuntu Server 16.04上安装了mysql 5.6:https://askubuntu.com/questions/762384/install-mysql-5-6-on-ubuntu-16-04

But i'm having trouble getting mysqld to read /etc/mysql/my.cnf

但是我无法让mysqld读取/etc/mysql/my.cnf

Specifically i'm trying to set it up for an Atlassian Confluence installation where I have to add in these settings:

具体来说,我正在尝试将其设置为Atlassian Confluence安装,我必须在这些设置中添加:

[mysqld]
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=2G

I've checked mysqld --help --verbose and it has the my.cnf in its path. Here's the relevant output:

我检查了mysqld --help --verbose,它的路径中有my.cnf。这是相关的输出:

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 The following
groups are read: mysqld server mysqld-5.6

I know that mysql is reading the file because if I change [mysqld] to [mysql] the arguments are correctly printed when I run mysql --print-defaults also if I put a wrong line in the file mysql will fail to start and tell me where the syntax error is. However mysqld does not report any arguments for mysqld --print-defaults or tell me about syntax errors in the file.

我知道mysql正在读取文件,因为如果我将[mysqld]更改为[mysql],当我运行mysql时,参数被正确打印--print-defaults如果我在文件中放错了行mysql将无法启动并告诉我在哪里语法错误。但是,mysqld不会报告mysqld --print-defaults的任何参数,也不会告诉我文件中的语法错误。

What else can I try?

我还能尝试什么?

Solved:

my.cnf was a symbolic link. I deleted it and made it an actual file. Now mysqld --show-defaults is working! So apparently mysql will follow the symlink but mysqld will not. Good to know.

my.cnf是一个象征性的链接。我删除它并使其成为一个实际的文件。现在mysqld --show-defaults正在运行!显然mysql将遵循符号链接,但mysqld不会。很高兴知道。

2 个解决方案

#1


6  

my.cnf was a symbolic link. I deleted it and made it an actual file. Now mysqld --show-defaults is working. So apparently mysql will follow the symlink but mysqld will not.

my.cnf是一个象征性的链接。我删除它并使其成为一个实际的文件。现在mysqld --show-defaults正在运行。显然mysql将遵循符号链接,但mysqld不会。

#2


0  

For mysqld as I know only hard links works. Or maybe you just had wrong permission, on original my.cnf file to which you put symbolic link.

对于mysqld,我知道只有硬链接才有效。或者你可能只是在你给它放置符号链接的原始my.cnf文件上有错误的权限。

#1


6  

my.cnf was a symbolic link. I deleted it and made it an actual file. Now mysqld --show-defaults is working. So apparently mysql will follow the symlink but mysqld will not.

my.cnf是一个象征性的链接。我删除它并使其成为一个实际的文件。现在mysqld --show-defaults正在运行。显然mysql将遵循符号链接,但mysqld不会。

#2


0  

For mysqld as I know only hard links works. Or maybe you just had wrong permission, on original my.cnf file to which you put symbolic link.

对于mysqld,我知道只有硬链接才有效。或者你可能只是在你给它放置符号链接的原始my.cnf文件上有错误的权限。