Everything is OK :
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://[mydns-or-ipwan]:3306/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='traccar'>[USER]</entry>
<entry key='XXXXX'>[PASSWORD]</entry>
In short, no way to connect to it internally, I have to go through the WAN.
Thank you all !
I had the same problem(s). Jérôme's solution does work but it is not the most logical and elegant solution. This is what i found out:
Situation:
- The setup containes three docker containers joint in a docker network. MariaDB, PHPMyAdmin an Traccar.
- The joint docker network was set to automatic configuration.
- PHPMyAdmin works, but Traccar doesn't connect to MariaDB (almost identical log file as Jérôme)
Solution:
- As Andrew stated, check if your MariaDB account has all the privileges (or use root).
- Search for the MariaDB container IP-address in the docker network.
1: SSH into your Synology NAS and use "sudo docker inspect [MARIADB_CONTAINER_NAME]". Look for the IP-address in the output.
2: If you don't know how to use SSH, go to network in the docker app and look for the gateway IP. The MariaDB container IP probably ends with "2" or "3" instead of “1” (just try in the next step until success).
- Use this MariaDB container IP-address in your entry key followed by port 3306.
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://[MARIADB_CONTAINER_IP]:3306/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>[USER]</entry>
<entry key='database.password'>[PASSWORD]</entry>
- No need for port forwarding or firewall adjustments.
So, there is a way to connect internally
Hope this helps someone
Everything is OK :
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry> <entry key='database.url'>jdbc:mysql://[mydns-or-ipwan]:3306/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry> <entry key='traccar'>[USER]</entry> <entry key='XXXXX'>[PASSWORD]</entry>
In short, no way to connect to it internally, I have to go through the WAN.
Thank you all !