MySQL not picking up symlinked cnf changes in 5.7.13 on Ubuntu 16.04 -


edit: may have found might part of issue, further edit @ bottom.

i've got new server setup running mysql seems okay. except whenever use show variables configuration settings can see in .cnf file not being shown , appear general defaults being shown. appear while can use mysql fine, settings defaults.

i trying figure out why .cnf not being used. have taken number of steps check being loaded , these laid out below. once sure being loaded @ loss how explain why settings aren't being used. appreciated.

the location of cnf file this:

/etc/mysql/mysql.conf.d/mysqld.cnf

i have attempted verify being used following:

sudo /usr/sbin/mysqld --verbose --help | grep -a 1 "default options"

default options read following files in given order:

/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

/etc/my.cnf not exist

/etc/mysql/my.cnf symlink /etc/alternatives/my.cnf

/etc/alternatives/my.cnf symlink /etc/mysql/mysql.cnf

/etc/mysql/mysql.cnf contains:

!includedir /etc/mysql/conf.d/

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

etc/mysql/conf.d/ directory contains:

mysql.cnf

mysqldump.cnf

mysql.cnf empty presumably isn’t doing anything

/etc/mysql/mysql.conf.d/ directory contains:

mysqld.cnf

mysqld.cnf.dpkg-new

mysqld_safe_syslog.cnf

mysqld.cnf symlink /home/{my_username}/conf/mysqld.cnf

/home/{my_username}/conf/mysqld.cnf conf file expect using.

so cannot see problem looks should using config.

in second attempt verify .cnf being used used strace mysql. file listed , opened along other paths listed above.

stat("/etc/mysql/mysql.conf.d/mysqld.cnf", {st_mode=s_ifreg|0664, st_size=2262, ...}) = 0 open("/etc/mysql/mysql.conf.d/mysqld.cnf", o_rdonly) = 4 fstat(4, {st_mode=s_ifreg|0664, st_size=2262, ...}) = 0 read(4, "# generated percona configura"..., 4096) = 2262 read(4, "", 4096)                       = 0 close(4)                          = 0 close(4) 

again looks should using .cnf file.

can offer insight why it's not?

edit: i've done strace mysqld instead of strace mysql , permission error on .cnf file. problem. don't understand enough difference between mysql , mysqld can explain?

stat("/etc/mysql/mysql.conf.d/mysqld.cnf", {st_mode=s_ifreg|0664, st_size=3218, ...}) = 0 open("/etc/mysql/mysql.conf.d/mysqld.cnf", o_rdonly) = -1 eacces (permission denied) 

this caused , resolved apparmor

ubuntu comes called apparmor, kernel-integrated application security system controls how applications can access file system. source: oracle article

if put .cnf in custom location, need give mysql permissions access directory. in case needed edit /etc/apparmor.d/local/usr.sbin.mysqld following:

/home/{my_username}/conf/mysqld.cnf r 

you use:

/home/{my_username}/conf/* r 

to give access whole directory.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -