# Loading class \`com.mysql.jdbc.Driver'. This is deprecated. The new driver class is \`com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary

**URL:** <https://discuss.elastic.co/t/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class-is-com-mysql-cj-jdbc-driver-the-driver-is-automatically-registered-via-the-spi-and-manual-loading-of-the-driver-class-is-generally-unnecessary/157687>\
**Category:** Logstash\
**Created:** [November 21, 2018, 11:09am UTC](https://discuss.elastic.co/t/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class-is-com-mysql-cj-jdbc-driver-the-driver-is-automatically-registered-via-the-spi-and-manual-loading-of-the-driver-class-is-generally-unnecessary/157687 "2018-11-21T11:09:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![muyuqj](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@muyuqj](https://discuss.elastic.co/u/muyuqj)\
**Post date:** [November 21, 2018, 11:09am UTC](https://discuss.elastic.co/t/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class-is-com-mysql-cj-jdbc-driver-the-driver-is-automatically-registered-via-the-spi-and-manual-loading-of-the-driver-class-is-generally-unnecessary/157687/1 "2018-11-21T11:09:12Z")

</div>

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is`com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

my jdbc config is  
jdbc\_driver\_library =\>"/usr/local/logstash/mysql-connector-java-8.0.12/mysql-connector-java-8.0.12.jar"  
jdbc\_driver\_class =\> "com.mysql.cj.jdbc.Driver"

some people says the problem is jdbc\_driver\_class ,but i use com.mysql.cj.jdbc.Driver ,it still not work.  
i guess is the jdbc plugins code problem.

---

<div class="post-metadata">

**Author:** ![balumurari1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/balumurari1/32/39203_2.png) [@balumurari1](https://discuss.elastic.co/u/balumurari1)\
**Post date:** [November 21, 2018, 11:15am UTC](https://discuss.elastic.co/t/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class-is-com-mysql-cj-jdbc-driver-the-driver-is-automatically-registered-via-the-spi-and-manual-loading-of-the-driver-class-is-generally-unnecessary/157687/2 "2018-11-21T11:15:36Z")

</div>

try this,

input {

jdbc {  
jdbc\_driver\_library =\> "D:/Softwares/logstash-6.4.2/lib/com.mysql.jdbc\_5.1.5.jar"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/test"  
jdbc\_user =\> "root"  
jdbc\_password =\> "root"  
statement =\> "SELECT \* FROM sample"  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "50000"  
}

}

output{  
elasticsearch { codec =\> json hosts =\> ["localhost:9200"] index =\> "mysqldata" }  
stdout { codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![muyuqj](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@muyuqj](https://discuss.elastic.co/u/muyuqj)\
**Post date:** [November 21, 2018, 11:18am UTC](https://discuss.elastic.co/t/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class-is-com-mysql-cj-jdbc-driver-the-driver-is-automatically-registered-via-the-spi-and-manual-loading-of-the-driver-class-is-generally-unnecessary/157687/3 "2018-11-21T11:18:29Z")

</div>

I know it work,but i want use MySQL Connector/J 8.0

---

<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:** [December 19, 2018, 11:18am UTC](https://discuss.elastic.co/t/loading-class-com-mysql-jdbc-driver-this-is-deprecated-the-new-driver-class-is-com-mysql-cj-jdbc-driver-the-driver-is-automatically-registered-via-the-spi-and-manual-loading-of-the-driver-class-is-generally-unnecessary/157687/4 "2018-12-19T11:18:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
