# SQL syntax error writing access log to database.

**URL:** https://community.wowza.com/t/sql-syntax-error-writing-access-log-to-database/47860
**Category:** Wowza Streaming Engine
**Created:** [January 11, 2017, 2:14am UTC](https://community.wowza.com/t/sql-syntax-error-writing-access-log-to-database/47860 "2017-01-11T02:14:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tobias\_Dedenroth](https://avatars.discourse-cdn.com/v4/letter/t/5f9b8f/32.png) [@Tobias\_Dedenroth](https://community.wowza.com/u/Tobias_Dedenroth)
#### Post date: [January 11, 2017, 2:14am UTC](https://community.wowza.com/t/sql-syntax-error-writing-access-log-to-database/47860/1 "2017-01-11T02:14:09Z")

</div>

Hello.

I am running into problems when trying to log to an MySQL database.

Following this article: [https://www.wowza.com/docs/how-to-log-to-a-mysql-database](https://www.wowza.com/docs/how-to-log-to-a-mysql-database)

Enviroment:

- Centos 7 (held updated)

- Wowza 4.4.0 (build 17748)

- MariaDB 5.5.52

Done following:

- Created the database “wowzalogs” with the table “accesslog” using the CREATE from the article

- Can successfully view empty table from commandline mysql

- Placed mysql-connector-java-5.1.8-bin.jar in /lib

- Edited log4j.properties to add “SQ” catergory to the first line

- Added the appender as copypaste from article. Only changed password. Using localhost and root user

- Restarted wowza streaming engine

Results:

- Nothing is written to the database

Errors from running Wowza in console mode:

```auto
[Events prior to this, not sure if thats interesting...?] 
INFO application app-start _definst_ live/_definst_
INFO server comment - ServerListenerStreamPublisher: Stream name is 'liveTVstream2'
log4j:ERROR Failed to excute sql
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'liveTVstream2'', '-', '-', '-', '4.272', '-', '-', '-', '-', '-', '-', '-', '-',' at line 1
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
        at com.mysql.jdbc.Util.getInstance(Util.java:387)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:942)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2526)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2673)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
        at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1540)
        at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2595)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1468)
        at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:218)
        at org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:289)
        at org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:186)
        at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at org.apache.log4j.Category.forcedLog(Category.java:391)
        at org.apache.log4j.Category.log(Category.java:838)
        at com.wowza.wms.logging.WMSLogger.log(WMSLogger.java:203)
        at com.wowza.wms.logging.WMSLogger.info(WMSLogger.java:238)
        at com.wowza.wms.plugin.collection.serverlistener.ServerListenerStreamPublisher.loadSchedule(ServerListenerStreamPublisher.java:367)
        at com.wowza.wms.plugin.collection.serverlistener.ServerListenerStreamPublisher.onServerInit(ServerListenerStreamPublisher.java:291)
        at com.wowza.wms.server.Server.l(Server.java:4461)
        at com.wowza.wms.server.Server.start(Server.java:1112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at com.wowza.wms.bootstrap.Bootstrap.startServer(Bootstrap.java:628)
        at com.wowza.wms.bootstrap.Bootstrap.main(Bootstrap.java:67)
INFO stream create - -
INFO stream publish liveTVstream2 -
[Events after this too...]

```

I noticed the _‘liveTVstream2’’_ contains two apostrophes. Suspecting thats the issue. But the app-name is simply _liveTVstream2_. No idea why it would try to insert an extra apostrophe.

Any suggestions? Thanks in advance.

---

<div class="post-metadata">

### Author: ![Jason\_Hatchett](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/jason_hatchett/32/391_2.png) [@Jason\_Hatchett](https://community.wowza.com/u/Jason_Hatchett)
#### Post date: [May 17, 2017, 10:22am UTC](https://community.wowza.com/t/sql-syntax-error-writing-access-log-to-database/47860/2 "2017-05-17T10:22:02Z")

</div>

Hello Tobias,

If you are still facing this issue, connecting the Logging from Wowza Streaming Engine to your MariaDB, can you log a support ticket here:

[https://www.wowza.com/support/open-ticket](https://www.wowza.com/support/open-ticket)

Without seeing the full log entries, and the configuration files involved, I would not be able to carry out a proper investigation into this issue.

Regards,

Jason Hatchett
