Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

Solved Go to solution
Highlighted

Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

Expert Contributor

Hi Team , 

 

I am having issues while connecting to mysql database using apache nifi.  The error is as follows

Cannot create PoolableConnectionFactory

 

Please note that Apache Nifi and MySQL is installed on the same Linux server and hence there shouldn't be any problems with the 2 applications talking to each other. 

 

The database connection pool settings is provided below

mysql_db_connection_pool.jpg

 

The error when I try extracting the records is provided below

mysql_db_connection_pool_error.jpg

 

 

This is something very urgent as we are doing a POC and if this succeeds our Projects will be based on this. Any help in this regard will be much appreciated. 

 

@Matt @Shu 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted

Re: Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

Expert Contributor

Hi All , 

I fixed this by changing the source URL to  jdbc:mysql://127.0.0.1:3306/source . 

 

I still need to understand the reason as to why it works this way when both the applications are installed on the same linux box . Also to note that in my case I have this linux installed on a VM on Google Cloud Platform

 

I will work on it and post the reasoning for reference.

Thanks 

View solution in original post

Re: Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

@abhinav_joshi  its related to permissions for root user.  First, you should avoid root user.  Also recommend use FQDNs, not ips.   It seems that user has perms on the localhost ip, but maybe not when connecting from the external IP.    If you make a specific user, you would need to grant them access to a database from a specific host.  For example:

 

CREATE DATABASE hive;
CREATE USER 'hive'@'hdp3.cloudera.com' IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'hdp3.cloudera.com' WITH GRANT OPTION;
FLUSH PRIVILEGES;

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

View solution in original post

3 REPLIES 3
Highlighted

Re: Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

Expert Contributor

Hi All , 

I fixed this by changing the source URL to  jdbc:mysql://127.0.0.1:3306/source . 

 

I still need to understand the reason as to why it works this way when both the applications are installed on the same linux box . Also to note that in my case I have this linux installed on a VM on Google Cloud Platform

 

I will work on it and post the reasoning for reference.

Thanks 

View solution in original post

Re: Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

@abhinav_joshi  its related to permissions for root user.  First, you should avoid root user.  Also recommend use FQDNs, not ips.   It seems that user has perms on the localhost ip, but maybe not when connecting from the external IP.    If you make a specific user, you would need to grant them access to a database from a specific host.  For example:

 

CREATE DATABASE hive;
CREATE USER 'hive'@'hdp3.cloudera.com' IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'hdp3.cloudera.com' WITH GRANT OPTION;
FLUSH PRIVILEGES;

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven

View solution in original post

Highlighted

Re: Apache Nifi Mysql Connectivity - Cannot create PoolableConnectionFactory

Expert Contributor

Thanks @stevenmatison for your response on this

Don't have an account?
Coming from Hortonworks? Activate your account here