# Using JDBC input meet Incorrect key file for table '/tmp/#sql\_c33\_0.MYI'

**URL:** <https://discuss.elastic.co/t/using-jdbc-input-meet-incorrect-key-file-for-table-tmp-sql-c33-0-myi/49277>\
**Category:** Logstash\
**Created:** [May 5, 2016, 10:35am UTC](https://discuss.elastic.co/t/using-jdbc-input-meet-incorrect-key-file-for-table-tmp-sql-c33-0-myi/49277 "2016-05-05T10:35:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caoliuxue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caoliuxue/32/9623_2.png) [@caoliuxue](https://discuss.elastic.co/u/caoliuxue)\
**Post date:** [May 5, 2016, 10:35am UTC](https://discuss.elastic.co/t/using-jdbc-input-meet-incorrect-key-file-for-table-tmp-sql-c33-0-myi/49277/1 "2016-05-05T10:35:13Z")

</div>

Im trying to use a jdbc input to migrate data to ES, I googled but not found a nice solution.  
This is my conf file:  
`input { jdbc { jdbc_driver_library => "mysql-connector-java-5.1.36.jar" jdbc_driver_class => "com.mysql.jdbc.Driver" jdbc_connection_string => "jdbc:mysql://*.*.*.*:3306/log" jdbc_user => "user" jdbc_password => "pwd" jdbc_paging_enabled => true jdbc_page_size => 100000 #parameters => { "CharSet" => "gbk" , "Datetime" => "True"} schedule => "* * * * *" statement => "SELECT * from app_log where id > :sql_last_value" use_column_value => true tracking_column => id last_run_metadata_path => ".logstash_jdbc_last_run_prod" } } output { elasticsearch { index => app_log_prod } }`

But when I start logStash , always show msg as below and no data inserted into my ES:

`Java::JavaSql::SQLException: Incorrect key file for table '/tmp/#sql_c33_0.MYI'; try to repair it: SELECT count(*) AS`count`FROM (SELECT * from app_log where id > 0) AS`t1`LIMIT 1 {:level=>:error} Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::JavaSql::SQLException: Incorrect key file for table '/tmp/#sql_c33_0.MYI'; try to repair it>, :level=>:warn}`

Can anybody help me? Thanks a billion

---

<div class="post-metadata">

**Author:** ![caoliuxue](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/caoliuxue/32/9623_2.png) [@caoliuxue](https://discuss.elastic.co/u/caoliuxue)\
**Post date:** [May 6, 2016, 6:34am UTC](https://discuss.elastic.co/t/using-jdbc-input-meet-incorrect-key-file-for-table-tmp-sql-c33-0-myi/49277/2 "2016-05-06T06:34:59Z")

</div>

I found my solution from [here](http://stackoverflow.com/questions/11805793/incorrect-key-file-for-table-tmp-sql-3c51-0-myi-try-to-repair-it)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:59am UTC](https://discuss.elastic.co/t/using-jdbc-input-meet-incorrect-key-file-for-table-tmp-sql-c33-0-myi/49277/3 "2017-07-06T04:59:05Z")

</div>


