What's the error?
There is no error. It just keeps using the embedded database and not MySQL.
Have you restarted the service?
yes. So I changed the Config file to:
<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
<entry key='database.url'>jdbc:mysql://127.0.0.1:3306/traccar?serverTimezone=UTC&useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry>
<entry key='database.user'>root</entry>
<entry key='database.password'>password</entry>
And now get this error.
2020-09-08 23:19:38 WARN: Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
2020-09-08 23:19:43 ERROR: HikariPool-1 - Exception during pool initialization. - Public Key Retrieval is not allowed - UnableToConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2020-09-08 23:19:43 ERROR: Main method error - Public Key Retrieval is not allowed - UnableToConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
2020-09-08 23:19:43 WARN: JNA: Callback org.traccar.WindowsService$ServiceMain@15d49048 threw the following exception - Public Key Retrieval is not allowed - UnableToConnectException (... < DataManager:139 < *:89 < Context:292 < Main:110 < ...)
OK. Have you done any research before asking on the forum? Googling quickly gives me this solution:
AllowPublicKeyRetrieval=True
Hello,
everything is working normal out of the box. However I want to use a mysql database instead.
I have created a database 'track' in mysql (XAMPP).
I have altered the traccar.xml file as follows: However its still using the embedded database.
<?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='web.port'>8082</entry> <!-- <entry key='database.driver'>org.h2.Driver</entry> <entry key='database.url'>jdbc:h2:./data/database</entry> <entry key='database.user'>sa</entry> <entry key='database.password'></entry> --> <entry key='database.driver'>com.mysql.jdbc.Driver</entry> <entry key='database.url'>jdbc:mysql://localhost:3306/track?useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=''</entry> <entry key='database.user'>root</entry> <entry key='database.password'></entry> </properties>