4

While upgrading ETL scripts for Mysql 5.8 to MySQL8 upgrade, as soon as I have updated the data-integration/lib jar to mysql-connector-java-8.0.xx.jar, it has started blowing with following error.

Driver class 'org.gjt.mm.mysql.Driver' could not be found, make sure the 'MySQL' driver (jar file) is installed.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
Red Boy
  • 5,429
  • 3
  • 28
  • 41

7 Answers7

5

Could you please try to add both jars in

data-integration/lib

As I did, I have added the lastest jar of 5.x i.e mysql-connector-java-5.1.48.jarand the same version mine is 8.0.19 so i have added mysql-connector-java-8.0.19.jar i copied into location data-integration/lib .

After the test its working fine now.

Wajid Shaikh
  • 339
  • 3
  • 5
3

I did spent lot of time debugging and finally concluded, two things, I hope this may save others time in similar situation.

Reason: There is hardcoded jdbc drive name in org.pentaho.di.core.database.MySQLDatabaseMeta, and it always returns org.gjt.mm.mysql.Driver which is removed and new Driver with name com.mysql.jdbc.Driver or com.mysql.cj.jdbc.Driver should be used.

Solutions Any of below should be done to resolve.

  1. Continue using the old jdbc jar.
  2. Modify the org.pentaho.di.core.database.MySQLDatabaseMeta below method, compile and place it in classes directory.

    public String getDriverClass()  {
    if (getAccessType()==DatabaseMeta.TYPE_ACCESS_ODBC)
    {
        return "sun.jdbc.odbc.JdbcOdbcDriver";
    }
    else
    {
        return "com.mysql.cj.jdbc.Driver";
    }   }
    
  3. Use the Generic database connection, then you can specify the driver class yourself. (Based on @Cyrus comment.)

Pentaho open bug reference.

Red Boy
  • 5,429
  • 3
  • 28
  • 41
  • You can also use the Generic database connection, then you can specify the driver class yourself. – Cyrus Jun 20 '19 at 11:02
1

I was working with pdi 9.1, all I did to get rid of this error was to copy these two jar files in the data-integration\lib:

mysql-connector-java-5.1.49.jar
mysql-connector-java-5.1.49-bin.jar

The link to the zip folder is mentioned in the above comments

Restart your spoon! And that's it.

1

i just to use Pentaho version 9.1 - 9.1.0.0-324 and mysql-connector-java-8.0.25

1- Make sure the Pentaho is not running.

2- Download the mysql connector at the link below.(https://mvnrepository.com/artifact/mysql/mysql-connector-java)

3- Copy the .jar file (mysql-connector-java-8.0.25.jar) and paste it in your Lib folder:

Example: C:....\pentaho-data-integration\lib

4- Execute Pentaho (Spoon.bat)

Wiicho Orozco
  • 448
  • 1
  • 4
  • 9
0

MySQL driver for version 8 changed the class name. Therefore, you must set it as a Generic connection instead, and use com.mysql.jdbc.Driver as the class.

nsousa
  • 4,448
  • 1
  • 10
  • 15
0

I have fixed the issue by replacing mysql-connector-java-5.1.42-bin.jar with mysql-connector-java-5.1.44.jar

Reference

0

I am using Pentaho 9.1.0.0-324 and had the same problem. I downloaded the Everything app and through it I found that I have already a file named mysql-connector-j-8.0.31.jar at C:\Program Files (x86)\MySQL\Connector J 8.0\ folder. I simply copied the file into C:\Pentaho\lib and the problem solved. However, now I am getting another error as below:

Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed. Access denied for user 'root'@'localhost' (using password: YES)

Update
I solved the Access denied error by reinstalling MySQL with legacy password option along with a password without non-alphabetical symbols.

Mohsen
  • 971
  • 2
  • 11
  • 29