# Database Storage Unavailable

**URL:** <https://forum.inductiveautomation.com/t/database-storage-unavailable/8141>\
**Category:** Ignition\
**Created:** [March 11, 2014, 7:47pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141 "2014-03-11T19:47:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryce.troy](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@bryce.troy](https://forum.inductiveautomation.com/u/bryce.troy)\
**Post date:** [March 11, 2014, 7:47pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141/1 "2014-03-11T19:47:53Z")

</div>

Trying to log data using SQLTags Historian and all data is getting stuck in the Store and Forward engine. MySQL database connection appears valid, and SQLTags Providers shows 14 History Tags in the Default Historical scan class, but Store & Forward Engines show Database Storage Unavailable. Therefore, Local Cache is 4000+ and climbing. Console message:

java.lang.Exception: Could not store data, tag history store could not be initialized. Will try again soon.

I did a clean reinstall of MySQL but no change. Port 3306 is open, and root password is good. Test schema contains sqlth\* tables, but are all empty. Any ideas?

Ignition version 7.6.4  
MySQL version 5.2.47

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [March 13, 2014, 8:43pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141/2 "2014-03-13T20:43:17Z")

</div>

Are there any other error messages?  
What is the complete stack trace to this error?

You can set the level that is throwing this error to debug and you may get some additional information about what is going on. You can post it here.

---

<div class="post-metadata">

**Author:** ![bryce.troy](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@bryce.troy](https://forum.inductiveautomation.com/u/bryce.troy)\
**Post date:** [March 13, 2014, 10:12pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141/3 "2014-03-13T22:12:26Z")

</div>

I reinstalled MySQL 5.6.15.0 and reinstalled Ignition 7.6.4 and everything works fine now.  
No idea what the cause was, but it seems to be fixed . . .

---

<div class="post-metadata">

**Author:** ![accyroy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/accyroy/32/3386_2.png) [@accyroy](https://forum.inductiveautomation.com/u/accyroy)\
**Post date:** [March 14, 2014, 1:57pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141/4 "2014-03-14T13:57:33Z")

</div>

I’m coming up with the exact same problem!  
New install, everything working well until adding tags to historian.  
Ignition 7.6.4  
MySQL 5.6.16

Analysis DB and Production DB for the OEE module functioning perfectly.

For some reason ignition cannot write to the DB I am using for history. I have tried two different databases and same results each time.  
Same as above, stuck in store and forward, Database Storage Unavailable.

This is the error I get in the console:  
TagHistoryDatasourceSink  
Error Initializing Data Sink

```
Time Logger Message

```

[ERROR] 1:52:04 PM TagHistoryDatasourceSink Error initializing data sink.

com.mysql.jdbc.exceptions.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 ‘OPTION SQL\_SELECT\_LIMIT=1’ at line 1  
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)  
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2934)  
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1616)  
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1708)  
at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)  
at com.mysql.jdbc.Connection.execSQL(Connection.java:3178)  
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1408)  
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)  
at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRPreparedStatement.executeQuery(SRConnectionWrapper.java:833)  
at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper.runScalarPrepQuery(SRConnectionWrapper.java:194)  
at com.inductiveautomation.ignition.gateway.sqltags.history.storage.TagHistoryDatasourceSink.getDriverId(TagHistoryDatasourceSink.java:354)  
at com.inductiveautomation.ignition.gateway.sqltags.history.storage.TagHistoryDatasourceSink.createPartitionManager(TagHistoryDatasourceSink.java:252)  
at com.inductiveautomation.ignition.gateway.sqltags.history.storage.TagHistoryDatasourceSink.initialize(TagHistoryDatasourceSink.java:224)  
at com.inductiveautomation.ignition.gateway.history.sinks.AbstractSink.tryToInit(AbstractSink.java:112)  
at com.inductiveautomation.ignition.gateway.sqltags.history.storage.TagHistoryDatasourceSink.tryToInit(TagHistoryDatasourceSink.java:213)  
at com.inductiveautomation.ignition.gateway.history.sinks.AbstractSink.isAccepting(AbstractSink.java:129)  
at com.inductiveautomation.ignition.gateway.history.sinks.AbstractDatasourceSink.isAccepting(AbstractDatasourceSink.java:82)  
at com.inductiveautomation.ignition.gateway.sqltags.history.storage.TagHistoryDatasourceSink.isAccepting(TagHistoryDatasourceSink.java:288)  
at com.inductiveautomation.ignition.gateway.history.sinks.AggregateSink.isAccepting(AggregateSink.java:88)  
at com.inductiveautomation.ignition.gateway.history.forwarders.ForwarderThread.run(ForwarderThread.java:122)

Any help would be appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![greg.simpson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/greg.simpson/32/3135_2.png) [@greg.simpson](https://forum.inductiveautomation.com/u/greg.simpson)\
**Post date:** [March 17, 2014, 1:11pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141/5 "2014-03-17T13:11:04Z")

</div>

This issue is usually caused by the wrong JDBC driver being used in Ignition when connected to MySQL 5.6. This can be resolved by downloading the latest ConnectorJ zip file from the MsSQL database and then installing it in the gateway.

You can follow KB 154 to correct this issue.  
[inductiveautomation.com/support/kb?0=154](http://inductiveautomation.com/support/kb?0=154)

---

<div class="post-metadata">

**Author:** ![accyroy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/accyroy/32/3386_2.png) [@accyroy](https://forum.inductiveautomation.com/u/accyroy)\
**Post date:** [March 17, 2014, 1:55pm UTC](https://forum.inductiveautomation.com/t/database-storage-unavailable/8141/6 "2014-03-17T13:55:05Z")

</div>

Thanks Greg, that fixed the problem.

Cheers! ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
