0

I followed instructions here to see which configuration files MySQL looks for, here is the 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

I then made a ~/.my.cnf file as it suggested and put max_allowed_packet = 64M in there in the group mysqld. When I restart and do a mysql> show variables like 'max_allowed_packet'; it still has the value from the /etc/mysql/my.cnf file and not my new overridden one. I did verify that MySQL is looking by running strace mysql and it does a stat() and then open() on ~/.my.cnf but the variable never overrides.

Any ideas?

Community
  • 1
  • 1
Elijah Lynn
  • 12,272
  • 10
  • 61
  • 91
  • Are you sure that `~/.my.cnf` is a valid configuration source on your system? Please run `mysql --verbose --help` and post the appropriate section in your question. You can get more info on that in the question that you've linked. – Carsten Feb 21 '14 at 17:57
  • Yup, 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 I updated the question with this info. – Elijah Lynn Feb 21 '14 at 18:01
  • Check the perms to the file. Make sure all dirs and file itself is readable. – Mike Purcell Feb 21 '14 at 18:04
  • 1
    It is readable by ugo (664). Also, if I throw garbage in it then mysql will fail to start so it does appear to be scanning it. – Elijah Lynn Feb 21 '14 at 18:13
  • @MikePurcell I think you are on to something. I was running strace mysql and it had no issues with open(). But when I run strace mysqld it gives a permission denied after open(). Not sure why though. I chmod 777'd it but it doesn't appear to be working yet. I am guessing it may need to be root as the owner? – Elijah Lynn Feb 21 '14 at 18:26
  • Are you running selinux? Be sure /home has 755, /home/ has 755 and finally the file has 644 (or 664). – Mike Purcell Feb 21 '14 at 18:33
  • I am running Ubuntu 13.04. ~ is 755 and ~/.my.cnf is now 644. Did a sudo restart mysql but not yet successful. – Elijah Lynn Feb 21 '14 at 19:21
  • run `sestatus` from cli. If it's 0 then none selinux issue, if it's 1, you either have to disable selinux (not recommended) or add a custom policy to allow the mysql user access to the home directory. – Mike Purcell Feb 21 '14 at 20:10
  • sestatus is currently not installed. – Elijah Lynn Feb 21 '14 at 21:52
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/48109/discussion-between-elijah-lynn-and-mike-purcell) – Elijah Lynn Feb 21 '14 at 21:52
  • Also for the record it should be `my.cnf`, not `.my.cnf` – Mike Purcell Feb 21 '14 at 22:32
  • Were you able to resolve the issue? – Mike Purcell Feb 22 '14 at 17:14
  • Not yet actually. According to http://dev.mysql.com/doc/refman/5.0/en/option-files.html it is ~/.my.cnf – Elijah Lynn Feb 24 '14 at 16:44

0 Answers0