Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
apletschette
Contributor III
Contributor III

With build script I suddenly get "java.sql.SQLException: Access denied for user"

Hello,

I have a running script in "Talend Open Studio 7.3.1" which does nothing else then get MSSQL data to transfer it to a MySQL database. In the studio everything works fine and so I build my script.

All connection data is put in Contexts and in the build menu I did choose the following parameters below.

0695b00000Eaw8RAAR.png

0695b00000Eaw7YAAR.png

When I run the script "importTicketing_run.sh" it on my windows-development machine with "mintty 2.7.3" it also connects to the database just fine. When I run the same script on the target Linux-server I do get the following exception:

   [root@vm-***** plan]# sh /home/plan/Talend/importTicketing/importTickekting_run.sh

   Exception in component tDBOutput_1 (importTickekting)

   java.sql.SQLException: Access denied for user 'talend'@'vm-*****' (using password: YES)

          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1084)

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:926)

          at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1748)

          at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1288)

          at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2506)

          at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2539)

          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2321)

On the other side I do have running talend-scripts running on this host based on talend 7.1. Also I can connect to the mysql-database with the login-name above:

   [root@vm-**** plan]# mysql -u talend -p************************

   Welcome to the MySQL monitor. Commands end with ; or \g.

   Your MySQL connection id is 1148191

   Server version: 5.5.56 MySQL Community Server (GPL) by Remi

   

   Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

   

   Oracle is a registered trademark of Oracle Corporation and/or its

   affiliates. Other names may be trademarks of their respective

   owners.

   

   Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

   

   mysql>

I actually have no clue what could went wrong ...

Labels (3)
1 Solution

Accepted Solutions
apletschette
Contributor III
Contributor III
Author

The problem was quite simple:

 

I migrated from Talend7.1to Talend7.3 and I did not update my "lib" directory on the target server, so some ".jar" file seems no longer been compatible. I know updated the directory and everything is fine.

 

View solution in original post

18 Replies
gjeremy1617088143
Creator III
Creator III

on the build job menu you choose default context instead of prod, is that ok for you ?

apletschette
Contributor III
Contributor III
Author

thx for pointing thix, but yes "default" should be "prod" :

gjeremy1617088143
Creator III
Creator III

when you choose default in build windows ,you use default name context not prod name context (as you say you use prod as default, but you have also a default name context).

apletschette
Contributor III
Contributor III
Author

I did test this, but same problem, it's really weird

apletschette
Contributor III
Contributor III
Author

The problem was quite simple:

 

I migrated from Talend7.1to Talend7.3 and I did not update my "lib" directory on the target server, so some ".jar" file seems no longer been compatible. I know updated the directory and everything is fine.

 

aminegac
Creator
Creator

hi , the problem happens to me still in 2021 with talend 7.3 . i build my job after testing it and it works totally fine in the studio. but when I run the build .bat file , it crashes and says the same exact error as it showed for you.

Also, i added the user with same name and password on HOST localhost in my MySQL database to ensure it exists and gave it all privileges but yet it does not work in the cmd of windows 10 !!!

hi

@Xiaodi Shi​  any ideas about this please. I never been able to make even 1 job work after building it! I want to make scheduled tasks but this thing is blocking me from progress. 🙂

Talend OS 4 yrs / Java 17 Web Dev
Anonymous
Not applicable

Hello,

Is the build job from the same machine where Talend studio is installed?

Have you tried to change the datatype of password in context from "password" to "String" and try once to see if this issue still reprp? Any issue on Context value?

Best regards

Sabrina

aminegac
Creator
Creator

thx a lot @Xiaodi Shi​ 

It was all due to password i always type password in the field of password but it seems it does not save it well , now i used context variable named password and type String and value is my password ! it worked in CMD as a charm 😍

 

anyway i tried these before and it ouput this next

yes it is build in same machine , i created 3 users to ensure it gets the specific access to the DB when running ,i created localhost ,my fixed ip ,my domain user name as 3 hosts available .

they work in Talend as i tested today , but they don't work in cmd and it says :

 

java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=MY_IP)(port=3306)(type=master) : Access denied for user 'root'@'MY_MACHINE_USER' (using password: YES)

 

 

and also it says for the Ip as host :

 

java.sql.SQLException: Access denied for user 'root'@'MY_MACHINE_USER' (using password: YES)

 

 

Talend OS 4 yrs / Java 17 Web Dev
Anonymous
Not applicable

Hello,

I have made a testing from my side and I can't reproduce the issue with v7.3.1, the job works also when I export the job script. As I did, you export all the parameter as context variable.

When you have a context variable whose type is password, you do not need to use single or double quotes for the value, only enter the password.

Best regards

Sabrina