Hi, I am having problems configuring mysql. Below i copy my configuration file.
The connection to the db and user from command line is done correctly. But when I try to start Traccar it gives this error. No logs are present
Cosa può essere?
sudo systemctl status traccar
● traccar.service - traccar
Loaded: loaded (/etc/systemd/system/traccar.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sat 2024-08-03 14:56:24 CEST; 3s ago
Process: 2697 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, s>
Main PID: 2697 (code=exited, status=1/FAILURE)
CPU: 1.310s
<?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://192.168.0.161:3306/traccar2?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'>traccar2</entry>
<entry key='database.password'>xxxxxx</entry>
</properties>
If no logs, it usually indicates that your XML is invalid. Remember that you have to escape some characters, like &
, which I see you haven't done.
Thank you Anton, that was the problem.
I'll put the right line of code if anyone needs it
<entry key='database.url'>jdbc:mysql://192.168.0.161:3306/traccar2?zeroDateTimeBehavior=round&serverTimezone=UTC&allowPublicKeyRetrieval=true&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&charset=UTF-8&sessionVariables=sql_mode=""</entry>
actually I had copied that line above from there, but in the documentation there are no escape characters given, at least it seems to me
Please provide a screenshot.
I can see them now.
Strange. They probably got lost in one of the copy and paste I did
Hi, I am having problems configuring mysql. Below i copy my configuration file.
The connection to the db and user from command line is done correctly. But when I try to start Traccar it gives this error. No logs are present
Cosa può essere?
<?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://192.168.0.161:3306/traccar2?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'>traccar2</entry> <entry key='database.password'>xxxxxx</entry> </properties>