You are not using the correct configuration as recommended.
This is what in the documentation:
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://[HOST]:3306/[DATABASE]?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>[USER]</entry>
<entry key='database.password'>[PASSWORD]</entry>
Take a look there:
https://www.traccar.org/mysql/
I used instead of
com.mysql.cj.jdbc.Driverthis driver
com.mysql.jdbc.Driverbut other than that it is exactly as in the DB config page and it's not affecting the storage process of my server in any way.
By the way if i remove the entry of H2 in the config of databases and add nothing, my server still get and post data i don't know how.
It is like no effect is taking place if i alter the setup/traccar.xml server file
@hceccacci your config is also wrong with & not escaped character.
@ss88 I checked my production environment and found this configuration:
<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost:3306/[DATABASE]?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>[USER]</entry>
<entry key='database.password'>[PASSWORD]</entry>
@hceccacci alright thanks for the clarification.
Regards.
Traccar uses the database from the config file. There is no other place. So, if it still doesn't work, you'll have to double check everything on your end. Also remember to restart the service after any config change.
Hello Anton,
I am trying to connect my server traccar to a MySQL database which i have installed on my Windows 10 OS.
I have the server running from the code and access the interface with localhost:8082.
But data are being saved somewhere not in my MySQL database (probably in the already set H2) eventhough i set the configuration of MySQL as described in the documentation (https://www.traccar.org/mysql/) in the conf files :
traccar/setup/traccar.xml & traccar-web/conf/traccar.xml
like so :<entry key='database.driver'>com.mysql.jdbc.Driver</entry> <entry key='database.url'>jdbc:mysql://localhost:3306/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry> <entry key='database.user'>root</entry> <entry key='database.password'>pw</entry>
What's the problem with this config ?
Thank you.