Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysqld ignoring my.cnf (mysql 5.6 on Ubuntu 16.04 Server)

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

But i'm having trouble getting mysqld to read /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:

[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:

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.

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.

like image 362
Wilkins White Avatar asked Sep 12 '16 15:09

Wilkins White


People also ask

Where is my CNF file in MySQL Ubuntu?

cnf configuration file. Open and review the /etc/mysql/my. cnf file.

Where is my Mysqld CNF file?

cnf is located in /etc/mysql/my. cnf .

Where is my CNF in MySQL windows?

C:\Program Files\MySQL\MySQL Server 5.5\my. ini C:\Program Files\MySQL\MySQL Server 5.5\my. cnf.


1 Answers

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.

like image 65
Wilkins White Avatar answered Nov 15 '22 11:11

Wilkins White