Problems using Mysql

Ginnio Sarabia7 years ago

I'm trying for the first time to use traccar with mysql.

But I do not believe the tables apparently because of SQL SYNTAX error.

  1. TRACCAR XML
<?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="database.driver">com.mysql.jdbc.Driver</entry>
<entry key="database.url">jdbc:mysql://localhost:3306/traccar?useSSL=false&allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES</entry><entry key="database.user">FakeUser</entry>
<entry key="database.password">FakePassword</entry></properties>
  1. TRAKER-SERVER LOG
2018-04-26 10:03:42  INFO: Operating system name: Windows Server 2012 version: 6.2 architecture: amd64
2018-04-26 10:03:42  INFO: Java runtime name: Java HotSpot(TM) 64-Bit Server VM vendor: Oracle Corporation version: 25.171-b11
2018-04-26 10:03:42  INFO: Memory limit heap: 875mb non-heap: 0mb
2018-04-26 10:03:42  INFO: Character encoding: UTF-8 charset: UTF-8
2018-04-26 10:03:42  INFO: Version: 3.16-SNAPSHOT
2018-04-26 10:07:16  INFO: Operating system name: Windows Server 2012 version: 6.2 architecture: amd64
2018-04-26 10:07:16  INFO: Java runtime name: Java HotSpot(TM) 64-Bit Server VM vendor: Oracle Corporation version: 25.171-b11
2018-04-26 10:07:16  INFO: Memory limit heap: 875mb non-heap: 0mb
2018-04-26 10:07:16  INFO: Character encoding: UTF-8 charset: UTF-8
2018-04-26 10:07:16  INFO: Version: 3.16-SNAPSHOT
  1. WRAPPER LOG
WARNING|wrapper|Service traccar|18-04-26 10:03:41|YAJSW: yajsw-stable-12.12
WARNING|wrapper|Service traccar|18-04-26 10:03:41|OS   : Windows Server 2012/6.2/amd64
WARNING|wrapper|Service traccar|18-04-26 10:03:41|JVM  : Oracle Corporation/1.8.0_171/C:\Program Files\Java\jre1.8.0_171/64
INFO|wrapper|Service traccar|18-04-26 10:03:41|start delay: 0
INFO|wrapper|Service traccar|18-04-26 10:03:41|started process with pid 1188
INFO|1188/0|Service traccar|18-04-26 10:03:42|[INFO] StandardFileSystemManager - Using "C:\Windows\TEMP\vfs_cache" as temporary files store.
INFO|1188/0|Service traccar|18-04-26 10:03:42|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
INFO|1188/0|Service traccar|18-04-26 10:03:43|[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
INFO|1188/0|Service traccar|18-04-26 10:03:43|INFO 4/26/18 10:03 AM: liquibase: Clearing database change log checksums
INFO|1188/0|Service traccar|18-04-26 10:03:43|INFO 4/26/18 10:03 AM: liquibase: Successfully acquired change log lock
INFO|1188/0|Service traccar|18-04-26 10:03:43|INFO 4/26/18 10:03 AM: liquibase: Successfully released change log lock
INFO|1188/0|Service traccar|18-04-26 10:03:43|INFO 4/26/18 10:03 AM: liquibase: Successfully acquired change log lock
INFO|1188/0|Service traccar|18-04-26 10:03:45|INFO 4/26/18 10:03 AM: liquibase: Reading from traccar.DATABASECHANGELOG
INFO|1188/0|Service traccar|18-04-26 10:03:45|SEVERE 4/26/18 10:03 AM: liquibase: ./schema/changelog-master.xml: changelog-3.3::changelog-3.3::author: Change Set changelog-3.3::changelog-3.3::author failed.  Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, langua' at line 1 [Failed SQL: CREATE TABLE traccar.users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, hashedpassword VARCHAR(128) NOT NULL, salt VARCHAR(128) NOT NULL, readonly BIT(1) DEFAULT 0 NOT NULL, admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, language VARCHAR(128) DEFAULT 'en' NOT NULL, distanceunit VARCHAR(128) DEFAULT 'km' NOT NULL, speedunit VARCHAR(128) DEFAULT 'kmh' NOT NULL, latitude DOUBLE DEFAULT 0 NOT NULL, longitude DOUBLE DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL, CONSTRAINT PK_USERS PRIMARY KEY (id))]
INFO|1188/0|Service traccar|18-04-26 10:03:45|INFO 4/26/18 10:03 AM: liquibase: changelog-3.3::changelog-3.3::author: Successfully released change log lock
INFO|1188/0|Service traccar|18-04-26 10:03:45|java.lang.reflect.InvocationTargetException
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at java.lang.reflect.Method.invoke(Unknown Source)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at org.rzo.yajsw.app.WrapperJVMMain.executeMain(WrapperJVMMain.java:60)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at org.rzo.yajsw.app.WrapperJVMMain.main(WrapperJVMMain.java:43)
INFO|1188/0|Service traccar|18-04-26 10:03:45|Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set changelog-3.3::changelog-3.3::author:
INFO|1188/0|Service traccar|18-04-26 10:03:45|     Reason: liquibase.exception.DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, langua' at line 1 [Failed SQL: CREATE TABLE traccar.users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, hashedpassword VARCHAR(128) NOT NULL, salt VARCHAR(128) NOT NULL, readonly BIT(1) DEFAULT 0 NOT NULL, admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, language VARCHAR(128) DEFAULT 'en' NOT NULL, distanceunit VARCHAR(128) DEFAULT 'km' NOT NULL, speedunit VARCHAR(128) DEFAULT 'kmh' NOT NULL, latitude DOUBLE DEFAULT 0 NOT NULL, longitude DOUBLE DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL, CONSTRAINT PK_USERS PRIMARY KEY (id))]
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:619)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:51)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:79)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.Liquibase.update(Liquibase.java:214)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.Liquibase.update(Liquibase.java:192)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.Liquibase.update(Liquibase.java:188)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at org.traccar.database.DataManager.initDatabaseSchema(DataManager.java:304)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at org.traccar.database.DataManager.<init>(DataManager.java:87)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at org.traccar.Context.init(Context.java:333)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at org.traccar.Main.main(Main.java:35)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	... 6 more
INFO|1188/0|Service traccar|18-04-26 10:03:45|Caused by: liquibase.exception.DatabaseException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, langua' at line 1 [Failed SQL: CREATE TABLE traccar.users (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, hashedpassword VARCHAR(128) NOT NULL, salt VARCHAR(128) NOT NULL, readonly BIT(1) DEFAULT 0 NOT NULL, admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, language VARCHAR(128) DEFAULT 'en' NOT NULL, distanceunit VARCHAR(128) DEFAULT 'km' NOT NULL, speedunit VARCHAR(128) DEFAULT 'kmh' NOT NULL, latitude DOUBLE DEFAULT 0 NOT NULL, longitude DOUBLE DEFAULT 0 NOT NULL, zoom INT DEFAULT 0 NOT NULL, CONSTRAINT PK_USERS PRIMARY KEY (id))]
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:309)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:113)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1277)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1259)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.changelog.ChangeSet.execute(ChangeSet.java:582)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	... 15 more
INFO|1188/0|Service traccar|18-04-26 10:03:45|Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'admin BIT(1) DEFAULT 0 NOT NULL, map VARCHAR(128) DEFAULT 'osm' NOT NULL, langua' at line 1
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at java.lang.reflect.Constructor.newInstance(Unknown Source)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.Util.getInstance(Util.java:408)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2480)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2438)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.StatementImpl.executeInternal(StatementImpl.java:845)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:745)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:307)
INFO|1188/0|Service traccar|18-04-26 10:03:45|	... 20 more
INFO|wrapper|Service traccar|18-04-26 10:03:46|calling onStop
INFO|wrapper|Service traccar|18-04-26 10:03:46|Win service stop - timeout: 30000
INFO|wrapper|Service traccar|18-04-26 10:03:46|Win service wrapper.control -> stopping application
INFO|wrapper|Service traccar|18-04-26 10:03:46|Win service stop - after shutdown
INFO|wrapper|Service traccar|18-04-26 10:03:46|Win service stop - before notify
INFO|wrapper|Service traccar|18-04-26 10:03:46|Win service terminated

Thanks for the help community traccar and especially Anton Tananaev

Anton Tananaev7 years ago

What version of MySQL are you using?

Ginnio Sarabia7 years ago

8.0.11

Anton Tananaev7 years ago

I would recommend to try MySQL 5.7.