Driver problem with start traccar on VPS

Alex3 years ago

When I service start traccar
I ve got log notes:
/opt/traccar/logs/tracker-server.log

2021-11-22 21:35:56  INFO: HikariPool-1 - Starting...
2021-11-22 21:35:57  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
q2021-11-22 21:36:02 ERROR: HikariPool-1 - Exception during pool initialization. - Public Key Retrieval is not allowed - UnableToConnectException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)
2021-11-22 21:36:02 ERROR: Main method error - Public Key Retrieval is not allowed - UnableToConnectException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)
Anton Tananaev3 years ago

Have you tried searching before asking for help here? This is one of the first search results:

https://www.traccar.org/forums/topic/how-to-resolve-error-public-key-retrieval-is-not-allowed/

Alex3 years ago

Hello!
I did this and added the
allowPublicKeyRetrieval=true
useSSL=false
But trouble is the same

In this line

<entry key='database.url'>jdbc:mysql://[HOST]:3306/[DATABASE]?serverTimezone=UTC&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>

Add these parameters on traccar.xml:
allowPublicKeyRetrieval=true
useSSL=false

It will look like this:

<entry key='database.url'>jdbc:mysql://[HOST]:3306/[
Alex3 years ago

Hello!

2021-11-23 12:17:53  INFO: HikariPool-1 - Starting...
2021-11-23 12:17:53  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2021-11-23 12:17:59 ERROR: HikariPool-1 - Exception during pool initialization. - Access denied for user 'traccar'@'localhost' (using password: YES) - CJException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)
2021-11-23 12:17:59 ERROR: Main method error - Access denied for user 'traccar'@'localhost' (using password: YES) - CJException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)

My config

<?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://127.0.0.1:3306/traccar?useSSL=false&amp;allowPublicKeyRetrieval=true&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry>  
    <entry key='database.user'>traccar</entry>
    <entry key='database.password'>venera1841</entry>
</properties>
Alex3 years ago

Hello!

At the moment deamon is starting, but error with loading of driver's class .

Nov 24 08:02:49 traccar traccar[631182]: Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and m>

my ip is http://213.139.210.163:8082/

Anton Tananaev3 years ago

The error is pretty self explanatory:

Access denied for user 'traccar'@'localhost'