Pentaho connecting to MySQL database - mysql

I am working on Pentaho Data Integration tool version 7.1. I am trying to connect to a database using 'Table Input' step. but when I test the connection in this step in Pentaho it is giving me the below error message. I am able to connect to DB using the MySQL workbench (MySQL is 5.7). I have placed the 'mysql-connector-java-5.1.23-bin.jar' file in the lib folder. My Java is 1.8.0-131; I am using Windows 10.
Error connecting to database [mydb] :org.pentaho.di.core.exception.KettleDatabaseException:
Error occurred while trying to connect to the database
Error connecting to database: (using class org.gjt.mm.mysql.Driver)
Unknown database 'mydb'

Make sure your pentaho version supports mysql connector .if it is not, download the required version and paste -> extract the file and paste it in the
\pdi-ce-8.2.0.0-342\data-integration\lib
After that open spoon.bat goto menu ->tool->marketplace ->install
mysql plugin
Restart pentaho after installing mysql plugin.
then try connecting to mysql .Hope it will solve your issue

It looks like the JDBC does not find your database. It may come from a typing mistake in the name, password, that the user has not enough grant,...
To debug use the test button on the bottom of the new connection button:

Related

Cannot connect MySQL Server to Netbeans

I can't connect to my database using the "new connection" option by right-clicking on Databases in the services tab. I get the following error:
Error Image
Here is information about the server to help with a solution:
Server info
Additional server info
The password I have saved in keychain for the server is "password1" and the connection isn't working even though I entered that.
Ok I finally figured it out. I had to update the MySQL connector driver for Netbeans. I had version "mysql-connector-java-5.1.23-bin" installed and needed to add the new driver "mysql-connector-java-8.0.18.jar" to match the version of MySQL Workbench that I have.

Spring cloud dataflow not connecting to MySQL DB

I am trying to run my spring-dataflow-server-local with MySQL DB. But it says,
" java.sql.SQLInvalidAuthorizationSpecException: Access denied for user ''#'localhost' (using password: NO) "
I am running on my Windows Machine.
I used the same user name and password to connect to the same mysql from MySQL Workbench successfully.
I am running the dataflow server with the following command.
java -jar spring-cloud-dataflow-server-local-1.7.4.RELEASE.jar --spring.datasource.url=jdbc:mysql://127.0.0.1:3306/task_db --spring.datasource.username=username --spring.datasource.password=password --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
Please help me on how to fix this? anyone faced similar issues?
I have tested that the data flow server starts successfully using
Windows 10
MySQL 8.0.15
Java 1.8.0_66
With the same command line that you show. I used jdbc:mysql:localhost:3306/task_db and created the task_db schema before running the data flow server in the workbench.
When installing MySQL 8.0.15 there was an option for 'enhanced login security' or 'classic' security. I picked 'classic'.
Would need to know more of how your MySQL is set up.
To isolate things, try going through the getting started guide - there is a 'completed' folder you can just run - https://spring.io/guides/gs/accessing-data-mysql/ and see if you have any connection issues.

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 docker instance via DataGrip application

I have managed to successfully connect to a docker instance running MySQL via the mysql command line utility. However, I am struggling to do so via DataGrip application from JetBrains.
My mysql cli command is as follows:
mysql -h127.0.0.1 --port=8181 -uroot
The connection string that is generated in DataGrip is:
jdbc:mysql://127.0.0.1:8181
The error I am getting from DataGrip interface is:
[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Is there anything that need to change in DataGrip that I am missing. I have read that the connection has to also be done via TCP. Not sure how to check that DataGrip is doing that.
Update: I eventually found the problem was the docker container I was using. It seems DataGrip is not able to connect to version 8.0.1 (mysql:8.0.1) mysql docker container. I tested using version 5.7 of the container and could successfully connect.
I was having an issue connecting MySQL 8.0.3 using DataGrip. You need to download the JDBC driver from Oracle website. Select Developer Releases (Since this is an unstable version). The 8.0.8 version worked for me. Download and save in a project folder or something similar on your computer. You will gonna need it later.
Go to DataGrip: File > DataSources. Click on the + and select Driver:
Screenshot of the Step above
On the section Driver Files > Additional files click on the + and select the jar file you just downloaded
After that on the Class dropdown select com.mysql.jdbc.Driver
Mark Dialect as MySQL
On the section URL templates, put the Name as default and Template as jdbc:mysql://{host::localhost}?[:{port::3306}][/{database}?][\?<&,user={user},password={password},{:identifier}={:identifier}>]
Click on apply
Done!
Screenshot of MySQL 8.0.3 running on Datagrip
Add a new datasource using the new driver.
If you find the following error:
[01S00] The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support
You can do a temporary fix going to the Advanced tab and setting the serverTimezone variable for UTC as an example.
There are no *.jar-files anymore. Only *.deb-packages for my OS on the Oracle site https://dev.mysql.com/downloads/connector/j/5.1.html
So I selected driver Amazon Aurora MySQL for my MySQL 8.0.3 in docker.
It works!

Connecting Scala and Play-Slick to AWS MySQL

Having difficulty connecting to AWS MySQL database in a new Scala Play Slick application. I can connect to the database from MySQL Workbench.
application.conf contains:
db.default.user=myusername
db.default.password=mypassword
db.default.driver=com.mysql.jdbc.Driver
The problem may be in db.default.url=
The MySQL Workbench copy JDBC connection string command yields:
"jdbc:mysql://sperch-dev.coafgaprx2uf.us-east-1.rds.amazonaws.com:3306/?user=myusername"
Including the "user=" here as MySQL Workbench suggests seems redundant with db.default.user and anyway I get the error message "[SQLException: No database selected]" with or without it.
Having seen elsewhere the pattern for db.default.url as:
"jdbc:mysql://localhost:3306/DATABASENAME?characterEncoding=UTF-8"
I tried adding the database name:
"jdbc:mysql://sperch-dev.coafgaprx2uf.us-east-1.rds.amazonaws.com:3306/sperch-dev?characterEncoding=UTF-8"
That however generates the error message:
"Cannot connect to database [default]"
My db.default.user and db.default.password are the same as the working connection in MySQL Workbench.
Any suggestions?
Remove the Port number and user name from the db.default url. Below is an example of what works.
# Database configuration
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://your-rds-instance.us-west-1.rds.amazonaws.com/DATABASE_SCHEMA_HERE"
db.default.user=user
db.default.pass="password"