0

I'm on a Mac, using MySQL workbench, which is telling me the location of my my.cnf file is in /etc/, where I'm editing it. I set the permission on that file with chmod a-w.

In that my.cnf file, I have the following:

sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

Which is what I want. However, upon restarting MySQL and logging into its command line, I get this:

mysql> SELECT @@sql_mode;

| @@sql_mode |

| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |

1 row in set (0.00 sec)

Additional modes are being added. If I run the following (but not persistent) command: set global sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES;

This is what I'm seeing on console: mysql> SELECT @@sql_mode;

| @@sql_mode |

| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |

Exactly what I want.

Can anyone explain to me how/why these extra, unwanted sql modes are being added? And/or how I can get just these two modes to persist without the others?

  • Potentially a better fit for http://dba.stackexchange.com/ than Stack Overflow. – Jacob See May 11 '16 at 19:54
  • Well, just in case someone else has this issue, here it is. Unbeknownst to me, the default mode is the one I was seeing, which just happened to include both of the modes I needed, but also contained those that I couldn't have. The problem here was how I set permissions. Instead of what I had done (chmod a-w; read this somewhere, unfamiliar with using letters instead of numbers, not sure what the permissions should be, I used it, but it's wrong), using `chmod 644 my.cnf` fixed this issue. – Justin MacCreery May 14 '16 at 14:21

0 Answers0