Mysql connection problem

AVI6 years ago

Hi sir,
i am getting this site can't be reached error, If i am trying to connect through MySQL database or H2 TCP/IP connection
So anyone please help me in fixing this issue, i am trying this from last two weeks, plz help me ASAP
and that to this will work fine for the first time of connection, db tables everything created and i got data also in mysql db but after if mt computer restarts again it never works. so i got confused, what was the error or problem.
and also if like this error occurs i can;t able to restart traccar service also, again and again i need to restart my pc.

only it is working fine for normal h2 local file connection.

please help me in fixing this issue.

AVI6 years ago
<properties>

    <entry key='config.default'>./conf/default.xml</entry>
	<entry key='web.port'>8083</entry>

	<entry key='database.driver'>com.mysql.jdbc.Driver</entry> 
	<entry key='database.url'>jdbc:mysql://localhost:3306/avi_magnettracker?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
	<entry key='database.user'>root</entry> 
	<entry key='database.password'>root</entry>

</properties>

and this is how i connected to mysql db

AVI6 years ago
2019-05-25 16:36:52  INFO: HikariPool-1 - Starting...
2019-05-25 16:36:52  WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2019-05-25 16:36:52 ERROR: HikariPool-1 - Exception during pool initialization. - UTF-8; - UnsupportedEncodingException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-05-25 16:36:52 ERROR: Main method error - UTF-8; - UnsupportedEncodingException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2019-05-25 16:36:52  WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@6e2aa843 threw the following exception - UTF-8; - UnsupportedEncodingException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)

(These are the log errors i am getting)

Anton Tananaev6 years ago

Looks like your database URL is not encoded properly.

olaffreiz5 years ago

Looks like your database URL is not encoded properly.

https://www.traccar.org/mysql/

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

this is exactly how you specify in the documentation. I also have problem with connection to database.

olaffreiz5 years ago

EDIT #1

deleting serverTimezone has helped.
and also Driver: com.mysql.cj.jdbc.Driver
and deleting port from localhost can also solve the problem.