# Multiple Index Using JDBC River (MYSQL)

**URL:** https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722
**Category:** Elasticsearch
**Created:** [September 23, 2013, 12:12pm UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722 "2013-09-23T12:12:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![samaswin](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samaswin](https://discuss.elastic.co/u/samaswin)
#### Post date: [September 23, 2013, 12:12pm UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722/1 "2013-09-23T12:12:56Z")

</div>

Hello,  
I have used it successfully for indexing a single  
collection using JDBC river. However, I can't figure out how to index  
multiple  
collections from mysql.

This works for a single collection:  
curl -XPUT '[http://localhost:9200/\_river/employee/\_meta](http://localhost:9200/_river/employee/_meta)' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://localhost:3306/projectdb",  
"user": "root",  
"password": "root",  
"sql": "select id, name from employee"  
},  
"index": {  
"name": "employee\_idx",  
"type": "jdbc"  
}  
}'

When I add another collection for indexing using the following  
command:  
curl -XPUT '[http://localhost:9200/\_river/jobdetails/\_meta](http://localhost:9200/_river/jobdetails/_meta)' -d '{  
"type": "jdbc",  
"jdbc": {  
"driver": "com.mysql.jdbc.Driver",  
"url": "jdbc:mysql://localhost:3306/projectdb",  
"user": "root",  
"password": "root",  
"sql": "select id, name from jobdetails"  
},  
"index": {  
"name": "jobdetails\_idx",  
"type": "jdbc"  
}  
}'  
Nothing happens and the second index is not created. I am using the latest  
version of the river from github on ES 0.90. No Error in logs.  
Can any one help me regarding this. I am new in this. I need this immediately.

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [September 23, 2013, 12:37pm UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722/2 "2013-09-23T12:37:03Z")

</div>

Is there anything in the logs?

Probably there is a typo in "jdbc:mysql://1localhost:3306/projectdb" -  
isn't it 'localhost'?

Jörg

--  
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: ![samaswin](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samaswin](https://discuss.elastic.co/u/samaswin)
#### Post date: [September 23, 2013, 12:47pm UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722/3 "2013-09-23T12:47:35Z")

</div>

yes that is localhost only. Otherwise the first index won't create wright. The logs don't show any error message or warnings.  
Thanks,  
R Ashwin

---

<div class="post-metadata">

### Author: ![samaswin](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@samaswin](https://discuss.elastic.co/u/samaswin)
#### Post date: [October 1, 2013, 4:31am UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722/4 "2013-10-01T04:31:22Z")

</div>

Finally I resolved the problem. Now I can create multiple types.

--  
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: ![psspl](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@psspl](https://discuss.elastic.co/u/psspl)
#### Post date: [March 18, 2014, 12:04pm UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722/5 "2014-03-18T12:04:57Z")

</div>

Hello,

How do you resolve your issue of using multiple index using river. From your answer I can get that you are using multiple types not multiple index. I want to use multiple index. Can someone please suggest me how to achieve this?

---

<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, 1:42am UTC](https://discuss.elastic.co/t/multiple-index-using-jdbc-river-mysql/13722/6 "2017-07-06T01:42:32Z")

</div>


