Can't connect to mysql, default database works fine

runtracca month ago

Hello guys, I'm trying to figure this one. When I change traccar.xml to connect to mysql database traccar container keeps restarting and it shows nothing in docker logs. Everything is smooth with default database. Please let me know if you see something odd here

My traccar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM 'http://java.sun.com/dtd/properties.dtd'>
<properties>

    <!-- Documentation: https://www.traccar.org/configuration-file/ -->

<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://db:3306/traccar?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'>u_traccdb</entry>
<entry key='database.password'>AxVFb9hpCRGqmek</entry>

</properties>

Mysql run command:

docker run -d --name db --hostname db \
-v /home/test/traccar/db:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=uh4RD3rLgpAHa9x \
-e MYSQL_DATABASE=traccar \
-e MYSQL_USER=u_traccdb \
-e MYSQL_PASSWORD=AxVFb9hpCRGqmek \
--restart always library/mysql

It's local testing don't worry about pass

runtracca month ago

Resolved by creating bridge network