I wasted time installing on my VPS
Documentation have some errors
- To have validate XML file the xml version header must be enclosed in double quotes
- default.xml file do not exist in Traccar 6.2
- mysql driver is now : com.mysql.cj.jdbc.Driver
Below is my traccar.xml configuration file for mysql
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
<properties>
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost/traccardb?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>traccar</entry>
<entry key='database.password'>[passwordDB]</entry>
</properties>
Thanks for the feedback. I've updated the page.
I didn't know XML declaration should be double quotes only. Java seems to handle single quotes just fine. But updated to make sure it is valid by the standard.
Hi Anton
I spent some time finding out why the server wouldn't start when I changed database from H2 to Mysql.
Connection to server is rejected and database tables are not created
Several messages on the forum on this subject with error messages in the logs. Your answer was to see the validity of the XML configuration file
On my server, double quotes were the reason
I'm pretty confident that's not the reason. There must have been something else.
I wasted time installing on my VPS
Documentation have some errors
Below is my traccar.xml configuration file for mysql
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'> <properties> <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry> <entry key='database.url'>jdbc:mysql://localhost/traccardb?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry> <entry key='database.user'>traccar</entry> <entry key='database.password'>[passwordDB]</entry> </properties>