<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333176#M231373</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to connect to a MySQL RDS instance in AWS with Apache NiFi on Linux Ubuntu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MySQL database is behind a SSH tunnel which is working in a dedicated terminal. The MySQL database is accessible through another Linux terminal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ ssh -i /home/bernardo/.ssh/sshbernardo3.pem -N -L 33061:&amp;lt;db_name&amp;gt;.&amp;lt;id&amp;gt;.eu-west-1.rds.amazonaws.com:3306 &amp;lt;user&amp;gt;@&amp;lt;ip_address&amp;gt; -p &amp;lt;port&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have uploaded and unzipped the JDBC driver from &lt;A href="https://downloads.mysql.com/archives/c-j/" target="_blank"&gt;https://downloads.mysql.com/archives/c-j/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file java.sql.Driver is located in the directory /usr/share/java/META-INF/services in Linux&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have installed the jdbc connector in Linux and set up the user to use JDBC&lt;/P&gt;&lt;P&gt;$ sudo apt-get install libmysql-java&lt;/P&gt;&lt;P&gt;$ cd /home/bernardo&lt;/P&gt;&lt;P&gt;$ gedit .bashrc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added the following lines at the end of the file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Setting up the user to use JDBC&lt;/P&gt;&lt;P&gt;CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java-8.0.26.jar&lt;/P&gt;&lt;P&gt;export CLASSPATH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ source .bashrc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In NiFi I have used a DBCPConnectionPool1.15.2 controller service which is configured as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Connection URL: jbdc:mysql://127.0.0.1:33061/&amp;lt;db_name&amp;gt;&lt;BR /&gt;• Database Driver Class Name: java.sql.Driver&lt;BR /&gt;• Database Driver Location: /usr/share/java/META-INF/services&lt;BR /&gt;• Database User: &amp;lt;user&amp;gt;&lt;BR /&gt;• Password: &amp;lt;password&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When enabling the controller service, I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StandardControllerServiceNode[service=DBCPConnectionPool[id=2440f624-017e-1000-9467-8bb12dda6ca6], name=&amp;lt;controller_service_name&amp;gt;, active=true] Failed to invoke @OnEnabled method due to java.lang.NoSuchMethodException: java.sql.Driver.&amp;lt;init&amp;gt;()&lt;BR /&gt;causes: java.lang.InstantiationException: java.sql.Driver&lt;BR /&gt;causes: org.apache.nifi.processor.exception.ProcessException: Creating driver instance is failed: Creating driver instance is failed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hint?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the SW I have installed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ubuntu 18.04.6&lt;BR /&gt;openjdk version "11.0.13" 2021-10-19&lt;BR /&gt;javac 11.0.13&lt;BR /&gt;nifi-1.15.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bernardo&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 17:14:32 GMT</pubDate>
    <dc:creator>BerniHacker</dc:creator>
    <dc:date>2022-01-04T17:14:32Z</dc:date>
    <item>
      <title>Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333176#M231373</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to connect to a MySQL RDS instance in AWS with Apache NiFi on Linux Ubuntu.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MySQL database is behind a SSH tunnel which is working in a dedicated terminal. The MySQL database is accessible through another Linux terminal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ ssh -i /home/bernardo/.ssh/sshbernardo3.pem -N -L 33061:&amp;lt;db_name&amp;gt;.&amp;lt;id&amp;gt;.eu-west-1.rds.amazonaws.com:3306 &amp;lt;user&amp;gt;@&amp;lt;ip_address&amp;gt; -p &amp;lt;port&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have uploaded and unzipped the JDBC driver from &lt;A href="https://downloads.mysql.com/archives/c-j/" target="_blank"&gt;https://downloads.mysql.com/archives/c-j/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file java.sql.Driver is located in the directory /usr/share/java/META-INF/services in Linux&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have installed the jdbc connector in Linux and set up the user to use JDBC&lt;/P&gt;&lt;P&gt;$ sudo apt-get install libmysql-java&lt;/P&gt;&lt;P&gt;$ cd /home/bernardo&lt;/P&gt;&lt;P&gt;$ gedit .bashrc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added the following lines at the end of the file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Setting up the user to use JDBC&lt;/P&gt;&lt;P&gt;CLASSPATH=$CLASSPATH:/usr/share/java/mysql-connector-java-8.0.26.jar&lt;/P&gt;&lt;P&gt;export CLASSPATH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ source .bashrc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In NiFi I have used a DBCPConnectionPool1.15.2 controller service which is configured as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Connection URL: jbdc:mysql://127.0.0.1:33061/&amp;lt;db_name&amp;gt;&lt;BR /&gt;• Database Driver Class Name: java.sql.Driver&lt;BR /&gt;• Database Driver Location: /usr/share/java/META-INF/services&lt;BR /&gt;• Database User: &amp;lt;user&amp;gt;&lt;BR /&gt;• Password: &amp;lt;password&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When enabling the controller service, I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StandardControllerServiceNode[service=DBCPConnectionPool[id=2440f624-017e-1000-9467-8bb12dda6ca6], name=&amp;lt;controller_service_name&amp;gt;, active=true] Failed to invoke @OnEnabled method due to java.lang.NoSuchMethodException: java.sql.Driver.&amp;lt;init&amp;gt;()&lt;BR /&gt;causes: java.lang.InstantiationException: java.sql.Driver&lt;BR /&gt;causes: org.apache.nifi.processor.exception.ProcessException: Creating driver instance is failed: Creating driver instance is failed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any hint?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the SW I have installed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ubuntu 18.04.6&lt;BR /&gt;openjdk version "11.0.13" 2021-10-19&lt;BR /&gt;javac 11.0.13&lt;BR /&gt;nifi-1.15.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bernardo&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 17:14:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333176#M231373</guid>
      <dc:creator>BerniHacker</dc:creator>
      <dc:date>2022-01-04T17:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333215#M231383</link>
      <description>&lt;P&gt;My Linux is running on VirtualBox 6.1 on top of Windows 10 Pro.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 07:43:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333215#M231383</guid>
      <dc:creator>BerniHacker</dc:creator>
      <dc:date>2022-01-05T07:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333260#M231392</link>
      <description>&lt;P&gt;The file mysql-connector-java-8.0.26.jar is in /usr/share/java&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ cat /usr/share/java/META-INF/services/java.sql.Driver&lt;/P&gt;&lt;P&gt;com.mysql.cj.jdbc.Driver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO, I have made the following changes to the DBCPConnectionPool1.15.2 controller service configuration:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Driver Class Name: com.mysql.cj.jdbc.Driver&lt;BR /&gt;• Database Driver Location: /usr/share/java/mysql-connector-java-8.0.26.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other parameters are not changed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Connection URL: jbdc:mysql://127.0.0.1:33061/&amp;lt;db_name&amp;gt;&lt;/P&gt;&lt;P&gt;• Database User: &amp;lt;user&amp;gt;&lt;BR /&gt;• Password: &amp;lt;password&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$ netstat -nplt&lt;/P&gt;&lt;P&gt;Active Internet connections (only servers)&lt;BR /&gt;Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name&lt;BR /&gt;&lt;BR /&gt;tcp 0 0 127.0.0.1:33061 0.0.0.0:* LISTEN 4873/ssh&lt;BR /&gt;tcp6 0 0 ::1:33061 :::* LISTEN 4873/ssh&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still I get an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;causes: org.apache.nifi.processor.exception.ProcessException: No suitable driver for the given Database Connection URL&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 18:00:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333260#M231392</guid>
      <dc:creator>BerniHacker</dc:creator>
      <dc:date>2022-01-05T18:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333666#M231480</link>
      <description>&lt;P&gt;I thought it could be an issue related to the &lt;STRONG&gt;driver version&lt;/STRONG&gt; so I re-installed the jdbc driver. I have cleaned /home/bernardo/Download and /usr/share/java from the old sql related files. Then I have done the installation again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Install the jdbc connector&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo apt&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;get&lt;/SPAN&gt; install libmysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The .jar file is in /usr/share/java/mysql-connector-java-5.1.45.jar Unpack the .jar file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo jar xvf &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;usr&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;share&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;mysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;connector&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java&lt;SPAN class="hljs-number"&gt;-5.1&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.45&lt;/SPAN&gt;.jar&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To find the driver class name, open /usr/share/java/META-INF/services/java.sql.Driver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cat &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;usr&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;share&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;META&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;INF&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;services&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java.sql.Driver

com.mysql.jdbc.Driver

com.mysql.fabric.jdbc.FabricMySQLDriver&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The driver class name is: com.mysql.jdbc.Driver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the updated configuration in the DBCPConnectionPool1.15.2 controller service in Apache Ni-Fi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Driver Class Name: com.mysql.jdbc.Driver&lt;/P&gt;&lt;P&gt;• Database Driver Location: /usr/share/java/mysql-connector-java-5.1.45.jar&lt;/P&gt;&lt;P&gt;• Database Connection URL: jbdc:mysql://127.0.0.1:33061/&amp;lt;db_name&amp;gt;&lt;/P&gt;&lt;P&gt;• Database User: &amp;lt;db_user&amp;gt;&lt;/P&gt;&lt;P&gt;• Password: &amp;lt;db_password&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have obtained the same result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;causes: org.apache.nifi.processor.exception.ProcessException: No suitable driver for the given Database Connection URL&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Then I checked if the problem was in the &lt;STRONG&gt;SSH tunnel&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ netstat &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;nplt
Active Internet connections (&lt;SPAN class="hljs-keyword"&gt;only&lt;/SPAN&gt; servers)
Proto Recv&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;Q Send&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;Q &lt;SPAN class="hljs-keyword"&gt;Local&lt;/SPAN&gt; Address           &lt;SPAN class="hljs-keyword"&gt;Foreign&lt;/SPAN&gt; Address          State       PID&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;Program name    
tcp        &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;      &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt;:&lt;SPAN class="hljs-number"&gt;33061&lt;/SPAN&gt;         &lt;SPAN class="hljs-number"&gt;0.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;:&lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;               LISTEN      &lt;SPAN class="hljs-number"&gt;4497&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;ssh
tcp        &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;      &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt;:&lt;SPAN class="hljs-number"&gt;3306&lt;/SPAN&gt;          &lt;SPAN class="hljs-number"&gt;0.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;:&lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;               LISTEN      &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;                              
tcp6       &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;      &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt; ::&lt;SPAN class="hljs-number"&gt;1&lt;/SPAN&gt;:&lt;SPAN class="hljs-number"&gt;33061&lt;/SPAN&gt;               :::&lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;                    LISTEN      &lt;SPAN class="hljs-number"&gt;4497&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;ssh     

$ cat &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;proc&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;4497&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;status

Name:   ssh
State:  S (sleeping)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SSH process is in sleeping state.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a separate terminal I accessed the remote MySQL database:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ mysql &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;u &lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;db_user&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;p &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;h &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;P &lt;SPAN class="hljs-number"&gt;33061&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I tried to connect to my local mysql database in my local Linux instance by using the following Ni-Fi settings:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Driver Class Name: com.mysql.jdbc.Driver&lt;/P&gt;&lt;P&gt;• Database Driver Location: /usr/share/java/mysql-connector-java-5.1.45.jar&lt;/P&gt;&lt;P&gt;• Database Connection URL: jbdc:mysql://127.0.0.1:3306/&amp;lt;local_db_name&amp;gt;&lt;/P&gt;&lt;P&gt;• Database User: &amp;lt;local_db_user&amp;gt;&lt;/P&gt;&lt;P&gt;• Password: &amp;lt;local_db_password&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have obtained the same result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;causes: org.apache.nifi.processor.exception.ProcessException: No suitable driver for the given Database Connection URL&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Still, in a separate Linux terminal I am able to access the local mysql database&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;PRE&gt;$ mysql &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;u &lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;local_db_user&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;p &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;h &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;P &lt;SPAN class="hljs-number"&gt;3306&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:20:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333666#M231480</guid>
      <dc:creator>BerniHacker</dc:creator>
      <dc:date>2022-01-12T09:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333667#M231481</link>
      <description>&lt;P&gt;Hi have corrected a typo in Ni-Fi controller service configuration:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Connection URL: jdbc:mysql://127.0.0.1:33061/&amp;lt;local_db_name&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This way I solved the controller service problem and I have been able to enable it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I run the processor QueryDatabaseTable, I get the following error: &lt;STRONG&gt;Cannot create PoolableConnectionFactory - Communications link failure&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;QueryDatabaseTable[id=017e1003-c2d8-14cf-4e34-feee76411595] Unable to execute SQL select query SELECT * FROM periodic_measurements_test due to java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.): javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) ↳ causes: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago. ↳ causes: java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.) ↳ causes: org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The last packet successfully received from the server was 1 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The processor configuration is default, except for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Connection Pooling Service: &amp;lt; DBCPConnectionPool controller service name &amp;gt;&lt;/P&gt;&lt;P&gt;• Database Type: MySQL&lt;/P&gt;&lt;P&gt;• Table Name: periodic_measurements_test&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem might be due to the SSH tunnel but I cannot understand where the problem is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;netstat &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;nplt

Active Internet connections (&lt;SPAN class="hljs-keyword"&gt;only&lt;/SPAN&gt; servers)
Proto Recv&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;Q Send&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;Q &lt;SPAN class="hljs-keyword"&gt;Local&lt;/SPAN&gt; Address           &lt;SPAN class="hljs-keyword"&gt;Foreign&lt;/SPAN&gt; Address         State       PID&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;Program name    
tcp        &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;      &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt;:&lt;SPAN class="hljs-number"&gt;33061&lt;/SPAN&gt;         &lt;SPAN class="hljs-number"&gt;0.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;:&lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;               LISTEN      &lt;SPAN class="hljs-number"&gt;29483&lt;/SPAN&gt;&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;ssh           
tcp        &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;      &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt;:&lt;SPAN class="hljs-number"&gt;3306&lt;/SPAN&gt;          &lt;SPAN class="hljs-number"&gt;0.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;:&lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;               LISTEN      &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;                                      
tcp        &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt;      &lt;SPAN class="hljs-number"&gt;0&lt;/SPAN&gt; &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt;:&lt;SPAN class="hljs-number"&gt;8443&lt;/SPAN&gt;          &lt;SPAN class="hljs-number"&gt;0.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;:&lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;               LISTEN      &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;     &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in Linux terminal I can still access the MySQL database thorough CLI:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ mysql &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;u &lt;SPAN class="hljs-operator"&gt;&amp;lt;&lt;/SPAN&gt;db_user&lt;SPAN class="hljs-operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;p &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;h &lt;SPAN class="hljs-number"&gt;127.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.1&lt;/SPAN&gt; &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;P &lt;SPAN class="hljs-number"&gt;33061&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The controller service configuration is still:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Connection URL: jdbc:mysql://127.0.0.1:33061/&amp;lt;db_name&amp;gt;&lt;/P&gt;&lt;P&gt;• Database Driver Class Name: com.mysql.jdbc.Driver&lt;/P&gt;&lt;P&gt;• Database Driver Location: /usr/share/java/mysql-connector-java-5.1.45.jar&lt;/P&gt;&lt;P&gt;• Database User: &amp;lt;db_user&amp;gt;&lt;/P&gt;&lt;P&gt;• Password: &amp;lt;db_password&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 09:23:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333667#M231481</guid>
      <dc:creator>BerniHacker</dc:creator>
      <dc:date>2022-01-12T09:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to connect to MySQL database when using Apache NiFi in Linux Ubuntu</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333763#M231506</link>
      <description>&lt;P&gt;I managed to fix the issue. It was related to the version of the jdbc driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Linux browser go to &lt;A href="https://dev.mysql.com/downloads/connector/j/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://dev.mysql.com/downloads/connector/j/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Ubuntu Linux&lt;/P&gt;&lt;P&gt;• 18.04&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Download&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a CLI terminal go to the Downloads directory&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cd &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;home&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;bernardo&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;Downloads&lt;/PRE&gt;&lt;P&gt;Unpack the deb file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo dpkg &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;i mysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;connector&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java_8&lt;SPAN class="hljs-number"&gt;.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.26&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;-1&lt;/SPAN&gt;ubuntu18&lt;SPAN class="hljs-number"&gt;.04&lt;/SPAN&gt;_all.deb&lt;/PRE&gt;&lt;P&gt;Check where is the connector location in the file system&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ dpkg &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;L mysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;connector&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java &lt;SPAN class="hljs-operator"&gt;|&lt;/SPAN&gt; fgrep jar

&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;usr&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;share&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;mysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;connector&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java&lt;SPAN class="hljs-number"&gt;-8.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.26&lt;/SPAN&gt;.jar&lt;/PRE&gt;&lt;P&gt;Clean /usr/share/java from the previous jdbc driver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo rm mysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;connector&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java&lt;SPAN class="hljs-number"&gt;-5.1&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.45&lt;/SPAN&gt;.jar
$ sudo rm &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;r com
$ sudo rm &lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;r META&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;INF&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;Install the connector: unpack the .jar file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ sudo jar xvf &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;usr&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;share&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;mysql&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;connector&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;java&lt;SPAN class="hljs-number"&gt;-8.0&lt;/SPAN&gt;&lt;SPAN class="hljs-number"&gt;.26&lt;/SPAN&gt;.jar&lt;/PRE&gt;&lt;P&gt;To find the driver class name, open /usr/share/java/META-INF/services/java.sql.Driver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$ cat &lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;usr&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;share&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;META&lt;SPAN class="hljs-operator"&gt;-&lt;/SPAN&gt;INF&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;services&lt;SPAN class="hljs-operator"&gt;/&lt;/SPAN&gt;java.sql.Driver
com.mysql.cj.jdbc.Driver&lt;/PRE&gt;&lt;P&gt;The driver class name is: com.mysql.jdbc.Driver&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Restart Apache Ni-Fi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Modify the configuration of the controller service with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;• Database Driver Class Name: com.mysql.cj.jdbc.Driver&lt;/P&gt;&lt;P&gt;• Database Driver Location: /usr/share/java/mysql-connector-java-8.0.26.jar&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 14:50:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Not-able-to-connect-to-MySQL-database-when-using-Apache-NiFi/m-p/333763#M231506</guid>
      <dc:creator>BerniHacker</dc:creator>
      <dc:date>2022-01-13T14:50:45Z</dc:date>
    </item>
  </channel>
</rss>

