hey! I'm trying to connect a SQL Server database with PySpark however I'm getting this error when it comes to 'load()'. I tried every advice that I saw on Stack Overflow but nothing worked for me. Is there anybody who has experienced this error before?
My code:
spark.read.format('jdbc')\
.option('url','jdbc:sqlserver://[ip_address]:1433;database=Test;user=[username];password=[password];')\
.option('driver', 'com.microsoft.sqlserver.jdbc.SQLServerDriver')\
.option('dbtable', sqlQuery )\
.load()\
.show()
Error starts with:
Py4JJavaError Traceback (most recent call last)
Cell In[4], line 5
1 spark.read.format('jdbc')\
2 .option('url',sqlConnection)\
3 .option('driver', 'com.microsoft.sqlserver.jdbc.SQLServerDriver')\
4 .option('dbtable', sqlQuery )\
----> 5 .load()\
6 .show()
The last error I can't handle: (I can connect to DB with this user by using SQL Server Management Studio, and I tried 3 different users.)
Py4JJavaError: An error occurred while calling o34.load.
: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '[username]'. ClientConnectionId:b60537a5-bfbc-4e11-9d82-3