Error while connecting to a database: "Invalid Datasource" - mysql

I'm working in Pentaho Report Designer 5.2. While trying to connect to a MySQL database using JNDI I'm facing an error saying Invalid data source:'openflights'
but there exist a table "openflights" in my database.
Help on this would be much appreciated. Thanks!
Here is the JNDI Configuration
#MySQL - openflights
openflights/type=javax.sql.DataSource
openflights/driver=org.gjt.mm.mysql.Driver
openflights/user=pentaho_user
openflights/password=password
openflights/url=jdbc:mysql://localhost:3306/openflights

Where have you defined the JNDI details?
change DRIVER value to com.mysql.jdbc.Driver
add JNDI in "C:\Users{YOURUSER}.pentaho\simple-jndi\default.properties" then stop the bi server and lauch again

Related

MySQL Database Connection Failed in Anypoint studio

I'm trying to set a Database configuration in Anypoint Studio 7.14.0 in order to connect to the following MySQL database:
host : mudb.learn.mulesoft.com
port : 3306
user : mule
password : mule
database : training
but I keep receiving the following Connection error:
Can someone help me? I have been struggling for hours.
NOTE : The JDBC Driver for MySQL that I'm using is described in the following Maven dependency added to my Mule project

pentaho data integration - cant connect to mysql

anyone can help me to resolve my problem?
i can't connect from pentaho to mysql
Error connecting to database [mysql - simpeg] :org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver
i already add at \pdi-ce-8.2.0.0-342 PENTAHO\data-integration\lib
com.mysql.jdbc_5.1.5.jar
and i restart my PDI, when i try again, the problem is same.
please help me. Thanks
Pentaho Data Integration uses mysql-connector-java-5.x.xx-bin.jar to connect MySQL for example mysql-connector-java-5.1.49-bin.jar and you can download MySQL driver from here also you can find PDI's JDBC Drivers Reference from here

Connecting Pentaho to mysql database (localhost)

I download last version of MySQL jdbc connector (mysql-connector-java-8.0.13) and I put it in the following folders:
C:\Users\maria\Desktop\report-designer\report-designer\lib
and
C:\Users\maria\Desktop\report-designer\report-designer\lib\jdbc
And it shows me the following error:
Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.
org.gjt.mm.mysql.Driver
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
While, when I introduced the old version file (mysql-connector-java-5.1.34-bin) at the same folders as said before (above). Pentaho shows me the following error:
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
Could not create connection to database server.
org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
can someone help me?
Thank you!
Finally I manage to solve the error.
I put my jdbc connector (mysql-connector-java-8.0.13) into the following folder:
C:\Users\maria\Desktop\report-designer\report-designer\lib an
And I change the name of my MySQL DB.
Thank you
Stop Report Designer
Remove it from the 'C:\Users\maria\Desktop\report-designer\report-designer\lib\jdbc' directory
Restart Report designer
You can only have one jdbc driver in the lib directory for the db. So when you add the 5.1.34 driver, you are adding a second MySQL driver, causing that second error.

Cannot connect to MySql database from Eclipse : java/sql/SQLException

I have set up a database with MySql.
I want to connect to it from Eclipse.
I followed the same steps as mentioned in this link:
https://www.zkoss.org/wiki/Setup_MySQL_DB_in_Eclipse
So I am using this library for the driver:
mysql-connector-java-5.1.45
whhich I think is correct
The name of my database is "test" and the port used by MySql is 3306.
This is my configuration:
But when I test the connection it's giving me an error message :
"An internal error occurred during: "Ping server job". java/sql/SQLException"
I have looked more in details in the error log and I see error like this:
java.lang.NoClassDefFoundError: java/sql/Connection
I have turned off my firewall just to check, but it does not solve the issue.
Can someone tell me what I should check?
Thanks
I use Java version 1.7.0_80 and Eclipse Mars.2 Release (4.5.2).
I gave up and used MysQL Workbench which meets my needs.

How to connect jmeter with database by using mysql-connector-java?

I am using phpMyAdmin version 5.7.15 and database mysql-connector-java version 5.1.40, but I am unable to connect the database with jmeter3.0. Could you please advise?
Add your driver in jmeter/lib folder
Then add a JDBC Connection Configuration and fill in:
Database URL: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html
JDBC Driver class: com.mysql.jdbc.Driver
login and password
Variable Name will identify the connection
Then add a JDBC Request under a Thread Group
and fill in:
Variable Name : same value as the one in JDBC Connection Configuration
The other fields which depend on what you want to do
Read this tutorial:
https://jmeter.apache.org/usermanual/build-db-test-plan.html
If you're looking to learn jmeter correctly, this book will help you.