# Elasticsearch-river-jdbc, how to import data from mysql?

**URL:** <https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591>\
**Category:** Elasticsearch\
**Created:** [November 26, 2013, 1:52am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591 "2013-11-26T01:52:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Guo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_guo/32/1725_2.png) [@Daniel\_Guo](https://discuss.elastic.co/u/Daniel_Guo)\
**Post date:** [November 26, 2013, 1:52am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591/1 "2013-11-26T01:52:44Z")

</div>

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.  
I do it according to the github QuickStart[https://github.com/jprante/elasticsearch-river-jdbc/wiki/Quickstart](https://github.com/jprante/elasticsearch-river-jdbc/wiki/Quickstart),  
my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar  
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following  
command:  
curl -XPUT 'localhost:9200/\_river/my\_jdbc\_river/\_meta' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://10.10.79.202:3306/feedback",  
"user": "pvdm",  
"password": "pvdm",  
"sql": "select \* from vrs2\_playlist"  
},  
"index": {  
"index": "tvRank",  
"type": "vrs2\_playlist"  
}  
}'

No data from table vrs2\_playlist is imported, but a document is indexed  
into elasticsearch, that is: \_river/my\_jdbc\_river/\_meta

What's wrong with this, or did I miss something. Please help, thanks in  
advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 26, 2013, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591/2 "2013-11-26T05:57:50Z")

</div>

Don't know if it's your issue here but we don't support uppercase index name.  
Try tvrank

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 26 nov. 2013 à 02:52, Daniel Guo [daniel5hbs@gmail.com](mailto:daniel5hbs@gmail.com) a écrit :

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.  
I do it according to the github QuickStart, my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar  
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following command:  
curl -XPUT 'localhost:9200/\_river/my\_jdbc\_river/\_meta' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://10.10.79.202:3306/feedback",  
"user": "pvdm",  
"password": "pvdm",  
"sql": "select \* from vrs2\_playlist"  
},  
"index": {  
"index": "tvRank",  
"type": "vrs2\_playlist"  
}  
}'

No data from table vrs2\_playlist is imported, but a document is indexed into elasticsearch, that is: \_river/my\_jdbc\_river/\_meta

## What's wrong with this, or did I miss something. Please help, thanks in advance.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Daniel\_Guo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_guo/32/1725_2.png) [@Daniel\_Guo](https://discuss.elastic.co/u/Daniel_Guo)\
**Post date:** [November 26, 2013, 8:29am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591/3 "2013-11-26T08:29:54Z")

</div>

Hi, David:  
Thanks for your tip.  
You are right, the uppercase here is not correct.  
While my issue is not here. Actually I have to delete the \_river first,  
then I can import data, for example:  
first delete the river:  
$ curl -XDELETE 'localhost:9200/\_river'

then run the river, it works:  
curl -XPUT 'localhost:9200/\_river/rank\_river/\_meta' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://10.10.79.202:3306/feedback[http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF\_nB7hKNiqnlBqW60d8dDw0B1Oog](http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog)",

```
    "user": "pvdm", 
    "password": "pvdm", 
    "sql": "select * from vrs2_playlist"    

```

},  
"index": {  
"index": "rank",  
"type": "playlist"  
}  
}'  
I just don't konw why I cannot reuse the river.

On Tuesday, November 26, 2013 1:57:50 PM UTC+8, David Pilato wrote:

> Don't know if it's your issue here but we don't support uppercase index  
> name.  
> Try tvrank
> 
> HTH
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 26 nov. 2013 à 02:52, Daniel Guo \<[danie...@gmail.com](mailto:danie...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Hi, I try to use elasticsearch-river-jdbc to import data from mysql.  
> I do it according to the github QuickStart[https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fwiki%2FQuickstart&sa=D&sntz=1&usg=AFQjCNETAAL7EqBjscSKSJJGvri6uCYLQg](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fwiki%2FQuickstart&sa=D&sntz=1&usg=AFQjCNETAAL7EqBjscSKSJJGvri6uCYLQg),  
> my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar  
> in the right place. And my database connection is fine.
> 
> When I open a new terminal and try to import data using the following  
> command:  
> curl -XPUT 'localhost:9200/\_river/my\_jdbc\_river/\_meta' -d '{  
> "type": "jdbc",  
> "jdbc": {  
> "driver": "com.mysql.jdbc.Driver",  
> "url": "jdbc:mysql://10.10.79.202:3306/feedback[http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF\_nB7hKNiqnlBqW60d8dDw0B1Oog](http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog)",
> 
> ```
> "user": "pvdm", 
> "password": "pvdm", 
> "sql": "select * from vrs2_playlist"    
> },  
> "index": {  
> "index": "tvRank",  
> "type": "vrs2_playlist" 
> }   
> 
> ```
> 
> }'
> 
> No data from table vrs2\_playlist is imported, but a document is indexed  
> into elasticsearch, that is: \_river/my\_jdbc\_river/\_meta
> 
> What's wrong with this, or did I miss something. Please help, thanks in  
> advance.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 26, 2013, 8:31am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591/4 "2013-11-26T08:31:27Z")

</div>

If you have already a river running, AFAIK you can not update the river settings.  
So yes, removing and adding a new river is the way to do it.

My 2 cents

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 26 novembre 2013 at 09:29:59, Daniel Guo ([daniel5hbs@gmail.com](mailto:daniel5hbs@gmail.com)) a écrit:

Hi, David:  
Thanks for your tip.  
You are right, the uppercase here is not correct.  
While my issue is not here. Actually I have to delete the \_river first, then I can import data, for example:  
first delete the river:  
$ curl -XDELETE 'localhost:9200/\_river'

then run the river, it works:  
curl -XPUT 'localhost:9200/\_river/rank\_river/\_meta' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://10.10.79.202:3306/feedback",  
"user": "pvdm",  
"password": "pvdm",  
"sql": "select \* from vrs2\_playlist"  
},  
"index": {  
"index": "rank",  
"type": "playlist"  
}  
}'  
I just don't konw why I cannot reuse the river.

On Tuesday, November 26, 2013 1:57:50 PM UTC+8, David Pilato wrote:  
Don't know if it's your issue here but we don't support uppercase index name.  
Try tvrank

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 26 nov. 2013 à 02:52, Daniel Guo [danie...@gmail.com](mailto:danie...@gmail.com) a écrit :

Hi, I try to use elasticsearch-river-jdbc to import data from mysql.  
I do it according to the github QuickStart, my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar  
in the right place. And my database connection is fine.

When I open a new terminal and try to import data using the following command:  
curl -XPUT 'localhost:9200/\_river/my\_jdbc\_river/\_meta' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://10.10.79.202:3306/feedback",  
"user": "pvdm",  
"password": "pvdm",  
"sql": "select \* from vrs2\_playlist"  
},  
"index": {  
"index": "tvRank",  
"type": "vrs2\_playlist"  
}  
}'

No data from table vrs2\_playlist is imported, but a document is indexed into elasticsearch, that is: \_river/my\_jdbc\_river/\_meta

## What's wrong with this, or did I miss something. Please help, thanks in advance.

## You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com). For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Daniel\_Guo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_guo/32/1725_2.png) [@Daniel\_Guo](https://discuss.elastic.co/u/Daniel_Guo)\
**Post date:** [November 26, 2013, 9:17am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591/5 "2013-11-26T09:17:48Z")

</div>

Got it, thank you!

On Tuesday, November 26, 2013 4:31:27 PM UTC+8, David Pilato wrote:

> If you have already a river running, AFAIK you can not update the river  
> settings.  
> So yes, removing and adding a new river is the way to do it.
> 
> My 2 cents
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet[https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Fdadoonet&sa=D&sntz=1&usg=AFQjCNE-DMC3YEu3X\_lhRIhUzuSZGsaSqA](https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Fdadoonet&sa=D&sntz=1&usg=AFQjCNE-DMC3YEu3X_lhRIhUzuSZGsaSqA)  
> | @elasticsearchfr[https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Felasticsearchfr&sa=D&sntz=1&usg=AFQjCNGfXdQ98RWFMJXdiqpKnZb5GMg0zA](https://www.google.com/url?q=https%3A%2F%2Ftwitter.com%2Felasticsearchfr&sa=D&sntz=1&usg=AFQjCNGfXdQ98RWFMJXdiqpKnZb5GMg0zA)
> 
> Le 26 novembre 2013 at 09:29:59, Daniel Guo ([danie...@gmail.com](mailto:danie...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> Hi, David:  
> Thanks for your tip.  
> You are right, the uppercase here is not correct.  
> While my issue is not here. Actually I have to delete the \_river first,  
> then I can import data, for example:  
> first delete the river:  
> $ curl -XDELETE 'localhost:9200/\_river'
> 
> then run the river, it works:  
> curl -XPUT 'localhost:9200/\_river/rank\_river/\_meta' -d '{  
> "type": "jdbc",  
> "jdbc": {  
> "driver": "com.mysql.jdbc.Driver",  
> "url": "jdbc:mysql://10.10.79.202:3306/feedback[http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF\_nB7hKNiqnlBqW60d8dDw0B1Oog](http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog)",
> 
> ```
> "user": "pvdm",
> "password": "pvdm",
> "sql": "select * from vrs2_playlist"    
> 
> ```
> 
> },  
> "index": {  
> "index": "rank",  
> "type": "playlist"  
> }  
> }'  
> I just don't konw why I cannot reuse the river.
> 
> On Tuesday, November 26, 2013 1:57:50 PM UTC+8, David Pilato wrote:
> 
> > Don't know if it's your issue here but we don't support uppercase index  
> > name.  
> > Try tvrank
> > 
> > HTH
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 26 nov. 2013 à 02:52, Daniel Guo [danie...@gmail.com](mailto:danie...@gmail.com) a écrit :
> > 
> > Hi, I try to use elasticsearch-river-jdbc to import data from mysql.  
> > I do it according to the github QuickStart[https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fwiki%2FQuickstart&sa=D&sntz=1&usg=AFQjCNETAAL7EqBjscSKSJJGvri6uCYLQg](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fjprante%2Felasticsearch-river-jdbc%2Fwiki%2FQuickstart&sa=D&sntz=1&usg=AFQjCNETAAL7EqBjscSKSJJGvri6uCYLQg),  
> > my elasticsearch works fine and I put mysql-connector-java-5.1.27-bin.jar  
> > in the right place. And my database connection is fine.
> > 
> > When I open a new terminal and try to import data using the following  
> > command:  
> > curl -XPUT 'localhost:9200/\_river/my\_jdbc\_river/\_meta' -d '{  
> > "type": "jdbc",  
> > "jdbc": {  
> > "driver": "com.mysql.jdbc.Driver",  
> > "url": "jdbc:mysql://10.10.79.202:3306/feedback[http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF\_nB7hKNiqnlBqW60d8dDw0B1Oog](http://www.google.com/url?q=http%3A%2F%2F10.10.79.202%3A3306%2Ffeedback&sa=D&sntz=1&usg=AFQjCNF_nB7hKNiqnlBqW60d8dDw0B1Oog)",
> > 
> > ```
> > "user": "pvdm", 
> > "password": "pvdm", 
> > "sql": "select * from vrs2_playlist"    
> > },  
> > "index": {  
> > "index": "tvRank",  
> > "type": "vrs2_playlist" 
> > }   
> > 
> > ```
> > 
> > }'
> > 
> > No data from table vrs2\_playlist is imported, but a document is indexed  
> > into elasticsearch, that is: \_river/my\_jdbc\_river/\_meta
> > 
> > ## What's wrong with this, or did I miss something. Please help, thanks in advance.
> > 
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:04am UTC](https://discuss.elastic.co/t/elasticsearch-river-jdbc-how-to-import-data-from-mysql/14591/6 "2017-07-06T02:04:49Z")

</div>


