# Not working JDBC Mysql in UBUNTU 16 --- Homestead VAGRANT MACHINE

**URL:** https://discuss.elastic.co/t/not-working-jdbc-mysql-in-ubuntu-16-homestead-vagrant-machine/96818
**Category:** Logstash
**Created:** [August 11, 2017, 7:47pm UTC](https://discuss.elastic.co/t/not-working-jdbc-mysql-in-ubuntu-16-homestead-vagrant-machine/96818 "2017-08-11T19:47:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![David\_Barrera\_Bernal](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@David\_Barrera\_Bernal](https://discuss.elastic.co/u/David_Barrera_Bernal)
#### Post date: [August 11, 2017, 7:47pm UTC](https://discuss.elastic.co/t/not-working-jdbc-mysql-in-ubuntu-16-homestead-vagrant-machine/96818/1 "2017-08-11T19:47:12Z")

</div>

Hello !

Ive been trying to migrate the data from a mysql database into elasticsearch using LOGSTASH But not working.  
Both Elasticsearch and kibana are running and i created the logstash config file in /etc/logstash/conf.d

With the following settings :

echo "input {  
jdbc {  
jdbc\_driver\_library =\> "/etc/logstash/mysql-connector-java-5.1.43"  
jdbc\_driver\_class =\> "com.mysql.jdbc.Driver"  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/homestead"  
jdbc\_user =\> "homestead"  
jdbc\_password =\> "secret"

```
statement => "SELECT name FROM users"

```

}  
}  
output {  
elasticsearch {  
action =\> "index"  
hosts =\> ["your\_host"]  
index =\> "your\_index"  
document\_type =\> "your\_type"  
}  
}  
" \>\> /etc/logstash/conf.d/mystash.conf

Whenever i try to run the the command from /usr/share/logstash/bin as : logstash -f mystash.conf

Getting error : -bash: logstash: command not found

Anyone has an idea how to do this ?

PLease help ! Its frustrating af.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [August 11, 2017, 8:05pm UTC](https://discuss.elastic.co/t/not-working-jdbc-mysql-in-ubuntu-16-homestead-vagrant-machine/96818/2 "2017-08-11T20:05:11Z")

</div>

Apparently /usr/share/logstash/bin isn't in your path so you have to either

- add it to your path,
- invoke Logstash via `./logstash`, or
- invoke Logstash via `/usr/share/logstash/bin`.

---

<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: [September 8, 2017, 8:05pm UTC](https://discuss.elastic.co/t/not-working-jdbc-mysql-in-ubuntu-16-homestead-vagrant-machine/96818/3 "2017-09-08T20:05:23Z")

</div>

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