# Fail to log data from server database to elasticsearch

**URL:** https://discuss.elastic.co/t/fail-to-log-data-from-server-database-to-elasticsearch/193801
**Category:** Logstash
**Tags:** elastic-stack-monitoring
**Created:** [August 5, 2019, 1:19pm UTC](https://discuss.elastic.co/t/fail-to-log-data-from-server-database-to-elasticsearch/193801 "2019-08-05T13:19:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![samer](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@samer](https://discuss.elastic.co/u/samer)
#### Post date: [August 5, 2019, 1:19pm UTC](https://discuss.elastic.co/t/fail-to-log-data-from-server-database-to-elasticsearch/193801/1 "2019-08-05T13:19:26Z")

</div>

I had installed the jdbc plugin with the command logstash-plugin install .....  
and I had set the JAVA\_HOME with the command "setx JAVA\_HOME "path of java file"  
this the pipeline:  
input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:mysql://localhost:3306/d02e3f25"  
jdbc\_user =\> "d02e3f25@"  
jdbc\_password =\> "XcY3pV29UCr4HpUY"  
jdbc\_driver\_library =\> "C:/mysql-connector-java-8.0.11.jar"  
jdbc\_driver\_class =\> "com.mysql.cj.jdbc.Driver"  
statement =\> "SELECT \* from accelerometre"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "carsssss"  
document\_type =\> "safe"

```
}
stdout{
    codec => rubydebug }

```

}

and after running a had these errors :

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/4/1/4115182f4178b22cf0f1ab079984fd0278d017a5.jpeg)  
 ![Capture1](https://us1.discourse-cdn.com/elastic/original/3X/1/9/19b11e49901bdc936c58d69af8c8aa3af572caab.jpeg)

---

<div class="post-metadata">

### Author: ![Jenni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jenni/32/29684_2.png) [@Jenni](https://discuss.elastic.co/u/Jenni)
#### Post date: [August 6, 2019, 3:30pm UTC](https://discuss.elastic.co/t/fail-to-log-data-from-server-database-to-elasticsearch/193801/2 "2019-08-06T15:30:54Z")

</div>

I know that it seems obvious as there is an "Access denied" message. But you didn't explicitly say it, so I have to ask: Did you make sure that the user and password are right and the user may access the datebase via the localhost?

(If these are your real credentials, the @ in the user name that doesn't appear in the error message is irritating me slightly.)

---

<div class="post-metadata">

### Author: ![samer](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@samer](https://discuss.elastic.co/u/samer)
#### Post date: [August 8, 2019, 12:46pm UTC](https://discuss.elastic.co/t/fail-to-log-data-from-server-database-to-elasticsearch/193801/3 "2019-08-08T12:46:15Z")

</div>

it was a mistake the @ in the user name,  
I had changed the code because the user can't access to the database via the localhost because I log data from the server database.  
I had changed the jdbc\_connecting\_string from localhost to SERVER, the jdbc\_driver\_library and the jdbc\_driver\_class adequate for connecting data from the server

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/5/4/546e37b66168238b601382dc7f56d93ed96505d8.jpeg)

I get this error

 ![2](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df91556bbf28b39ad75f46262538ffda075ad204.jpeg)  
 ![3](https://us1.discourse-cdn.com/elastic/original/3X/e/8/e8f3bb6c09cb69aaab40e3711512ef2c509ad525.jpeg)

---

<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 5, 2019, 12:57pm UTC](https://discuss.elastic.co/t/fail-to-log-data-from-server-database-to-elasticsearch/193801/4 "2019-09-05T12:57:59Z")

</div>

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