Ubuntu Mysql Server

Drepain3 years ago

Hello guys I m new Traccar. i think this is an amazing job @Anton.

I am having trouble setting up a traccar server with mysql. The default database works fine.
I get this on the log:

ubuntu@ip-172-31-5-46:~$ cat /opt/traccar/logs/tracker-server.log
2021-12-02 12:04:37  INFO: HikariPool-1 - Starting...
2021-12-02 12:04:42 ERROR: HikariPool-1 - Exception during pool initialization. - Connection refused (Connection refused) - ConnectException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)
2021-12-02 12:04:42 ERROR: Main method error - Connection refused (Connection refused) - ConnectException (... < DataManager:130 < *:89 < Context:290 < Main:120 < ...)

Below is my config setting for the db:

    <entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
    <entry key='database.url'>jdbc:mysql://35.159.28.154:3306/traccardb?serverTimezone=UTC&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'>user</entry>
    <entry key='database.password'></entry>

I have my 3306 port opened on the server. I cant seem to find the issue.

Anton Tananaev3 years ago

Are you using remote database?

Drepain3 years ago

oops!
Thanks this has been beating me for a few days now thanks.

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

I changed ip to localhost and it works

Regards