<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to connect PostgreSQL from Databricks in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27846#M19694</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thank you Akash for posting the JDBC connection config for Postgres. &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Really wish it was part of the docs. &lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2019 05:32:19 GMT</pubDate>
    <dc:creator>charlesgreen</dc:creator>
    <dc:date>2019-10-25T05:32:19Z</dc:date>
    <item>
      <title>How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27842#M19690</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I am trying to connect PostgreSQL from Azure Databricks.&lt;/P&gt;
&lt;P&gt;I am using the below code to connect.&lt;/P&gt;
&lt;P&gt;jdbcHostname = "Test" &lt;/P&gt;
&lt;P&gt;jdbcPort = 1234&lt;/P&gt;
&lt;P&gt;jdbcDatabase = "Test1" &lt;/P&gt;
&lt;P&gt;jdbcUrl = "jdbc:postgresql://{0}:{1}/{2}".format(jdbcHostname, jdbcPort, jdbcDatabase)&lt;/P&gt;
&lt;P&gt;Connection was successful &lt;/P&gt;
&lt;P&gt;connectionProps = { "user": "userid", "password": "pass!" }&lt;/P&gt;
&lt;P&gt;Now, when I run the below command &lt;/P&gt;
&lt;P&gt;accountDF = spark.read.jdbc(url=jdbcUrl, table="POC_TABLE", properties=connectionProps) display(accountDF)&lt;/P&gt;
&lt;P&gt;I get the below error.&lt;/P&gt;
&lt;P&gt;org.postgresql.util.PSQLException: FATAL: SSL connection is required. Please specify SSL options and retry.&lt;/P&gt;
&lt;P&gt;How do I fix this error. I have SSL enabled in the postgreSQL at Azure portal.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Akash&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 07:11:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27842#M19690</guid>
      <dc:creator>akj2784</dc:creator>
      <dc:date>2019-09-19T07:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27843#M19691</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that you didn’t specify SSL options correctly. Please enable SSL and make sure to save it.&lt;/P&gt;&lt;P&gt;Please go through the steps in Documentation and follow them,   &lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/postgresql/concepts-ssl-connection-security" target="_blank"&gt;https://docs.microsoft.com/en-us/azure/postgresql/concepts-ssl-connection-security&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 07:39:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27843#M19691</guid>
      <dc:creator>shyam_9</dc:creator>
      <dc:date>2019-09-19T07:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27844#M19692</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SSL enforce status :ENABLED &lt;/P&gt;
&lt;P&gt;I see it in Azure portal for this database. What else is missing ?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 07:46:48 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27844#M19692</guid>
      <dc:creator>akj2784</dc:creator>
      <dc:date>2019-09-19T07:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27845#M19693</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please follow the steps in documentation and still if you are facing issue, reply here.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 08:05:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27845#M19693</guid>
      <dc:creator>shyam_9</dc:creator>
      <dc:date>2019-09-19T08:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27846#M19694</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thank you Akash for posting the JDBC connection config for Postgres. &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Really wish it was part of the docs. &lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 05:32:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27846#M19694</guid>
      <dc:creator>charlesgreen</dc:creator>
      <dc:date>2019-10-25T05:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27847#M19695</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am trying the same. What I am stuck is figuring out how to upload the Key and Certificate files for the JDBC driver to use when using SSL. The connection should look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;remote_table = spark.read.format("jdbc")\
  .option("driver", driver)\
  .option("url", url)\
  .option("dbtable", table)\
  .option("user", user)\
  .option("password", password)\
  .option("ssl", True) \
  .options("sslmode", "verify-full" ) \
  .options("sslcert", "path_to_cert" ) \
  .options("sslkey", "path_to_key" ) \
  .load()&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I dont know how or where to upload the certificate and and key, so when I ran it I get the following error:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;org.postgresql.util.PSQLException: SSL error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any idea how to upload the cert and key to the cluster so that JDBC can find it?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 09:56:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27847#M19695</guid>
      <dc:creator>JavierDe_La_Tor</dc:creator>
      <dc:date>2020-01-28T09:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27848#M19696</link>
      <description>&lt;P&gt; @Javier De La Torre do you really need two-way SSL (verify-full)? In most cases one way SSL (sslmode=require) should be enough.&lt;/P&gt;&lt;P&gt; @akj2784​&amp;nbsp; When you say "Connection was successful", where do you mean you established a successful connection? You might be missing the&lt;/P&gt;&lt;P&gt;.option("ssl", True) \ .options("sslmode", "require") &lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 09:38:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27848#M19696</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-13T09:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27849#M19697</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Did you resolve this? I'm having the same problem&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Oct 2020 21:05:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27849#M19697</guid>
      <dc:creator>TheodoreVadpey</dc:creator>
      <dc:date>2020-10-18T21:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27850#M19698</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;There are different possibilities:&lt;/P&gt;
&lt;P&gt;- You can upload them to the cluster using wget as explained in this article:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://carto.com/help/tutorials/sql-direct-databricks/" target="test_blank"&gt;https://carto.com/help/tutorials/sql-direct-databricks/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;- You can upload the files to an S3 bucket / Azure Blob and then read them from there&lt;/P&gt;
&lt;P&gt;- You can import them using the "Import and Explore Data" functionality in the Databricks Welcome page&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Oct 2020 08:11:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27850#M19698</guid>
      <dc:creator>BorjaMuñoz</dc:creator>
      <dc:date>2020-10-19T08:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27851#M19699</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi, thanks for your reply! I couldn't get it to work from dbfs location or driver-- just need to point to ssl-ca... I made a question for it here: &lt;A href="https://forums.databricks.com/questions/48860/connect-to-azure-mysql-with-ssl-through-jdbc.html" target="test_blank"&gt;https://forums.databricks.com/questions/48860/connect-to-azure-mysql-with-ssl-through-jdbc.html&lt;/A&gt;. Am I missing some option?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 15:10:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27851#M19699</guid>
      <dc:creator>TheodoreVadpey</dc:creator>
      <dc:date>2020-10-23T15:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27852#M19700</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;You are getting a SSL error. It seems you are using SSL mode "verify-full" that requires you to include certificate files to verify your identity, not only the server identity. I'm not familiar with MySQL but it seems "verify-full" is not a supported option.&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2020 11:37:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27852#M19700</guid>
      <dc:creator>BorjaMuñoz</dc:creator>
      <dc:date>2020-10-26T11:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect PostgreSQL from Databricks</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27853#M19701</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/azure/databricks/data/data-sources/sql-databases" target="test_blank"&gt;https://docs.microsoft.com/en-us/azure/databricks/data/data-sources/sql-databases&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The above link shows how to generate and add the required certificates&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 09:51:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-connect-postgresql-from-databricks/m-p/27853#M19701</guid>
      <dc:creator>RashidQuamar</dc:creator>
      <dc:date>2021-07-26T09:51:02Z</dc:date>
    </item>
  </channel>
</rss>

