ANSI_QUOTES as a parameter using MySQL

aspero9 years ago

Hi,

I've just installed traccar and it works great with my teltonika fm4200! Great job!
I use MySQL and when I updated sql_mode to ANSI_QUOTES, my other apps broke (i.e. owncloud).

But I thought that this could be passed as a parameter durning initialization. So I added a variable in traccar.xml config file (line 24):

UPDATE THIS LINE:

<entry key='database.url'>jdbc:mysql://127.0.0.1:3306/gps?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8</entry>

TO THIS:

<entry key='database.url'>jdbc:mysql://127.0.0.1:3306/gps?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_Mode=ANSI_QUOTES</entry>

Restart traccar server and you're done. Now only traccar uses ANSI_QUOTES, other apps still don't.

Hope this helps someone.
Again - great app!
Bartek.

Anton Tananaev9 years ago

Thanks for sharing this information. I will update the documentation as it sounds like much better and simpler solution that changing global MySQL mode.