QNAP Traccar - MySQL (MariaDB)

Lukasz6 years ago

Welcome. I install Traccar on QNAP but i want not use default database

<entry key='database.driver'>org.h2.Driver</entry>
<entry key='database.url'>jdbc:h2:/home/user/Documents/traccar/target/database</entry>
<entry key='database.user'>sa</entry>
<entry key='database.password'></entry>

But i Want use MYSQL database.

<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>

i create database and add user with permissions. But after that traccar not run and not create tables in database. Please help me to use QNap mysql database .

LOG

2019-04-02 12:18:33 DEBUG: validationTimeout...............5000
2019-04-02 12:18:33  INFO: HikariPool-1 - Starting...
2019-04-02 12:18:37 DEBUG: HikariPool-1 - Failed to create/setup connection: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
2019-04-02 12:18:37 DEBUG: HikariPool-1 - Cannot acquire connection from data source - Could not create connection to database server. Attempted reconnect 3 times. Giving up. - MySQLNonTransientConnectionException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2019-04-02 12:18:37 ERROR: HikariPool-1 - Exception during pool initialization. - Could not create connection to database server. Attempted reconnect 3 times. Giving up. - MySQLNonTransientConnectionException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2019-04-02 12:18:37 ERROR: Main method error - Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up. - PoolInitializationException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2019-04-02 12:22:02 DEBUG: Driver class com.mysql.jdbc.Driver found in Thread context class loader sun.misc.Launcher$AppClassLoader@33909752
2019-04-02 12:22:02 DEBUG: HikariPool-1 - configuration:
2019-04-02 12:22:02 DEBUG: allowPoolSuspension.............false
2019-04-02 12:22:02 DEBUG: autoCommit......................true
2019-04-02 12:22:02 DEBUG: catalog.........................none
2019-04-02 12:22:02 DEBUG: connectionInitSql..............."SELECT 1"
2019-04-02 12:22:02 DEBUG: connectionTestQuery.............none
2019-04-02 12:22:02 DEBUG: connectionTimeout...............30000
2019-04-02 12:22:02 DEBUG: dataSource......................none
2019-04-02 12:22:02 DEBUG: dataSourceClassName.............none
2019-04-02 12:22:02 DEBUG: dataSourceJNDI..................none
2019-04-02 12:22:02 DEBUG: dataSourceProperties............{password=<masked>}
2019-04-02 12:22:02 DEBUG: driverClassName................."com.mysql.jdbc.Driver"
2019-04-02 12:22:02 DEBUG: healthCheckProperties...........{}
2019-04-02 12:22:02 DEBUG: healthCheckRegistry.............none
2019-04-02 12:22:02 DEBUG: idleTimeout.....................600000
2019-04-02 12:22:02 DEBUG: initializationFailTimeout.......1
2019-04-02 12:22:02 DEBUG: isolateInternalQueries..........false
2019-04-02 12:22:02 DEBUG: jdbcUrl.........................jdbc:mysql://localhost:3306/traccar?useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''
2019-04-02 12:22:02 DEBUG: leakDetectionThreshold..........0
2019-04-02 12:22:02 DEBUG: maxLifetime.....................1800000
2019-04-02 12:22:02 DEBUG: maximumPoolSize.................10
2019-04-02 12:22:02 DEBUG: metricRegistry..................none
2019-04-02 12:22:02 DEBUG: metricsTrackerFactory...........none
2019-04-02 12:22:02 DEBUG: minimumIdle.....................10
2019-04-02 12:22:02 DEBUG: password........................<masked>
2019-04-02 12:22:02 DEBUG: poolName........................"HikariPool-1"
2019-04-02 12:22:02 DEBUG: readOnly........................false
2019-04-02 12:22:02 DEBUG: registerMbeans..................false
2019-04-02 12:22:02 DEBUG: scheduledExecutor...............none
2019-04-02 12:22:02 DEBUG: schema..........................none
2019-04-02 12:22:02 DEBUG: threadFactory...................internal
2019-04-02 12:22:02 DEBUG: transactionIsolation............default
2019-04-02 12:22:02 DEBUG: username........................"traccar"
2019-04-02 12:22:02 DEBUG: validationTimeout...............5000
2019-04-02 12:22:02  INFO: HikariPool-1 - Starting...
2019-04-02 12:22:07 DEBUG: HikariPool-1 - Failed to create/setup connection: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
2019-04-02 12:22:07 DEBUG: HikariPool-1 - Cannot acquire connection from data source - Could not create connection to database server. Attempted reconnect 3 times. Giving up. - MySQLNonTransientConnectionException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2019-04-02 12:22:07 ERROR: HikariPool-1 - Exception during pool initialization. - Could not create connection to database server. Attempted reconnect 3 times. Giving up. - MySQLNonTransientConnectionException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2019-04-02 12:22:07 ERROR: Main method error - Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up. - PoolInitializationException (... < DataManager:139 < *:89 < Context:389 < Main:110 < ...)
2019-04-02 12:25:09 DEBUG: Driver class com.mysql.jdbc.Driver found in Thread context class loader sun.misc.Launcher$AppClassLoader@33909752
2019-04-02 12:25:09 DEBUG: HikariPool-1 - configuration:
Tony Shelver6 years ago

Some of the more experienced guys can answer as well, but as a first step, have you tried to connect to MySQL using another tool with exactly the same connection string / information?

Lukasz6 years ago

Ivan connect phpmyadmin nad web aplications but not test this connection string

Ernesto Vallejo6 years ago

Seems to me like your database service is not running.

Lukasz6 years ago

Welcome again. I check now from android tablet app mysql browser and works . I can browse database. Its confirm to service is running. I think its problem with connection strings on traccar or something like this because not create tables and not connect to database.

Lukasz6 years ago

It's my traccar config:
[REMOVED]

Anton Tananaev6 years ago

If you want to provide full config file, upload it somewhere and give a link.

Lukasz6 years ago