Traccar v6.7.3 with mysql

Bibhuti Bhusan Rout 7 months ago

I want to integrate Traccar v6.7.3 with mysql db for my production uses what are the steps i need to followed

odhiambo 7 months ago

/opt/traccar/conf/traccar.xml contains all the config parameters:

 <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://DBHOST/DBNAME?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
    <entry key='database.user'>DBUSER</entry>
    <entry key='database.password'>SUPERSECRET</entry>

That should be it. It's now up to you to ensure the DB is accessible.

Bibhuti Bhusan Rout 7 months ago

After adding those above config on traccar.xml the run the jar file using >java -jar tracker-server.jar conf/traccar.xml and showing the log as

O: Version: 6.7.3
2025-06-24 15:51:56  INFO: Starting server...
2025-06-24 15:51:56  INFO: HikariPool-1 - Starting...
2025-06-24 15:51:57  INFO: HikariPool-1 - Added connection conn0: url=jdbc:h2:./data/database user=SA
2025-06-24 15:51:57  INFO: HikariPool-1 - Start completed.
2025-06-24 15:51:57  INFO: Set default schema name to PUBLIC
2025-06-24 15:51:57  INFO: Clearing database change log checksums
2025-06-24 15:51:57  INFO: Successfully acquired change log lock
2025-06-24 15:51:57  INFO: Successfully released change log lock
2025-06-24 15:52:00  INFO: Reading from PUBLIC.DATABASECHANGELOG
2025-06-24 15:52:00  INFO: Reading from PUBLIC.DATABASECHANGELOG
2025-06-24 15:52:00  INFO: Reading from PUBLIC.DATABASECHANGELOG
2025-06-24 15:52:00  INFO: UPDATE SUMMARY
2025-06-24 15:52:00  INFO: Run:                          0
2025-06-24 15:52:00  INFO: Previously run:              51
2025-06-24 15:52:00  INFO: Filtered out:                 0
2025-06-24 15:52:00  INFO: -------------------------------
2025-06-24 15:52:00  INFO: Total change sets:           51

connect with h2 database whyy ???

Anton Tananaev 7 months ago

You have to double-check everything you did. The only reason Traccar would use H2 is if you still have it in the config file.

Bibhuti Bhusan Rout 7 months ago

Solved

Anton Tananaev 7 months ago

Do you want to share details to help others?

Bibhuti Bhusan Rout 7 months ago

I am edit the traccar.xml file just open on a editor but that not fixed then we need to open with administator notepad then it will work with those configuration

Anton Tananaev 7 months ago

Sounds like you're not really saving your changes due to some permission issues.