Traccar 4.3 does not link with mysql

Nicolas Mejia6 years ago

good, I have a problem when I link with mysql

# service traccar status
 traccar.service - traccar
   Loaded: loaded (/etc/systemd/system/traccar.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2019-04-03 16:05:24 -05; 57s ago
  Process: 32611 ExecStart=/opt/traccar/jre/bin/java -jar tracker-server.jar conf/traccar.xml (code=exited, status=1/FAILURE)
 Main PID: 32611 (code=exited, status=1/FAILURE)

help me please

mdtaylorlrim6 years ago

Did you:
Create and empty database to hold the data and,
Place the proper code in the /opt/traccar/conf/traccar.xml using the correct database name and password??

<entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
<entry key='database.url'>jdbc:mysql://[HOST]:3306/[DATABASE]?useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
<entry key='database.user'>[USER]</entry> 
<entry key='database.password'>[PASSWORD]</entry>

Then restart traccar service?

Nicolas Mejia6 years ago

yes

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>





<properties>
 <entry key='config.default'>./conf/default.xml</entry>
  <entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
<entry key='database.url'>jdbc:mysql://localhost:3306/traccar?useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>
<entry key='database.user'>cocotic</entry> 
<entry key='database.password'>cocotic2019*</entry>

</properties> 
Anton Tananaev6 years ago

What error do you see in the logs?

Nicolas Mejia6 years ago
2019-03-30 12:33:25  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
Anton Tananaev6 years ago

I'll repeat my question again, if it was not clear. What error do you see in the logs?

Nicolas Mejia6 years ago

How can I see the errors in the logs?

I do not speak english, i am from colombia :)

Ernesto Vallejo6 years ago

Use google translator, we'll do fine with that. Your execution is failing, could be user privileges, wrong path, etc.

Nicolas Mejia6 years ago

logs

...
2019-04-05 17:36:45  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-04-05 17:36:45  INFO: Waiting for changelog lock....
2019-04-05 17:36:55  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-04-05 17:36:55  INFO: Waiting for changelog lock....
2019-04-05 17:37:05  INFO: SELECT `LOCKED` FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-04-05 17:37:05  INFO: Waiting for changelog lock....
2019-04-05 17:37:15  INFO: SELECT ID,`LOCKED`,LOCKGRANTED,LOCKEDBY FROM traccar.DATABASECHANGELOGLOCK WHERE ID=1
2019-04-05 17:37:15 ERROR: Main method error - Could not acquire change log lock.  Currently locked by 0:0:0:0:ef9e:8f3a:ac04:cf7b%enp2s0 (0:0:0:0:ef9e:8f3a:ac04:cf7b%e$