<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Logan Tai</title>
    <description>The latest articles on DEV Community by Logan Tai (@logantai24).</description>
    <link>https://dev.to/logantai24</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F253579%2Fad7eda01-849b-4018-93cf-414bf51666ac.png</url>
      <title>DEV Community: Logan Tai</title>
      <link>https://dev.to/logantai24</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/logantai24"/>
    <language>en</language>
    <item>
      <title>Create and connect a Siteground PostgreSQL Database</title>
      <dc:creator>Logan Tai</dc:creator>
      <pubDate>Sat, 26 Dec 2020 15:41:27 +0000</pubDate>
      <link>https://dev.to/logantai24/create-and-connect-a-siteground-postgresql-database-29el</link>
      <guid>https://dev.to/logantai24/create-and-connect-a-siteground-postgresql-database-29el</guid>
      <description>&lt;p&gt;Siteground is one of the top WordPress hosting providers, and you could use it for some &lt;strong&gt;database hosting&lt;/strong&gt; too! Sadly there hasn't been much documentation around for setting up PostgreSQL with Siteground (especially for newbies like myself), and Siteground's documentation on PostgreSQL isn't very updated for the new Site Tools.&lt;/p&gt;

&lt;p&gt;This article is a straightforward step-by-step guide on setting a PostgreSQL database in Siteground, and finding the needed information to remote connecting it.  &lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Postgresql Database in Siteground
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create a &lt;strong&gt;new site&lt;/strong&gt; in Siteground if haven't done so&lt;/li&gt;
&lt;li&gt;Head over to &lt;em&gt;Site Tools&lt;/em&gt;, find "PostgreSQL" under "SITE" section&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Since Siteground blocked access to your site's server, you have to whitelist IP addresses first. Go to the &lt;em&gt;REMOTE&lt;/em&gt; tab, add your ip address to the Remote Access Host. To make it more convenient, add &lt;code&gt;0.0.0.0/0&lt;/code&gt; into the list of the whitelisted host. &lt;strong&gt;Notice adding &lt;code&gt;0.0.0.0/0&lt;/code&gt; will allow all IPs to connect to your database if your database credentials are leaked&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iq7_CBGh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.slab.com/prod/uploads/8eyamqri/posts/images/riimyCkkY1iyI9SXjlzY5LKP.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iq7_CBGh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.slab.com/prod/uploads/8eyamqri/posts/images/riimyCkkY1iyI9SXjlzY5LKP.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch to &lt;em&gt;USERS&lt;/em&gt; tab, click "CREATE USER" and a user will be automatically created. If you don't like the default password, click the three dots under action and &lt;strong&gt;change the password&lt;/strong&gt; for this user (and save it somewhere else, you will need it later).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HD_cGjyT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.slab.com/prod/uploads/8eyamqri/posts/images/k9UXnvqAqVHNyZIuAupILVij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HD_cGjyT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.slab.com/prod/uploads/8eyamqri/posts/images/k9UXnvqAqVHNyZIuAupILVij.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Switch to the &lt;em&gt;DATABASES&lt;/em&gt; tab, click "CREATE DATABASE" and an empty postgresql database will be created. Click the Person icon under Actions to &lt;strong&gt;grant access&lt;/strong&gt; to the created user to this database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ffVRGAWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.slab.com/prod/uploads/8eyamqri/posts/images/DpiUO1Ol7FAsC5hGCegO-xad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ffVRGAWm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://static.slab.com/prod/uploads/8eyamqri/posts/images/DpiUO1Ol7FAsC5hGCegO-xad.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it for the Siteground part! Consider adding &lt;strong&gt;Labels&lt;/strong&gt; to both the database and user to make things easier to refer to in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup remote connection to the postgresql database
&lt;/h3&gt;

&lt;p&gt;For connecting a postgresql database, you will need to locate the below 5 information:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hostname/Address&lt;/li&gt;
&lt;li&gt;Port&lt;/li&gt;
&lt;li&gt;Database Name&lt;/li&gt;
&lt;li&gt;Username&lt;/li&gt;
&lt;li&gt;Password&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Database Name, Username &amp;amp; Password
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Database Name&lt;/em&gt;, &lt;em&gt;Username&lt;/em&gt; &amp;amp; &lt;em&gt;Password&lt;/em&gt; for this Siteground postgresql database are information you have just created if you have followed along, and these information are always accessible under the "SITE" → "PostgreSQL" section in &lt;em&gt;Site Tools&lt;/em&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Port
&lt;/h4&gt;

&lt;p&gt;According to Siteground's &lt;a href="https://www.siteground.com/kb/which_ports_are_open_on_siteground_shared_servers/"&gt;help center&lt;/a&gt;, 5432 is the default PostgreSql port.&lt;/p&gt;

&lt;h4&gt;
  
  
  Hostname/Address
&lt;/h4&gt;

&lt;p&gt;To locate the hostname of your server/database, head over to your site's "DASHBOARD"  via Site Tools. Find "Site IP" under "Site Information" → "IP and Name Servers" section, this IP address is all you need.&lt;/p&gt;

&lt;p&gt;You should now be able to connect to your Siteground PostgreSQL database!&lt;/p&gt;

</description>
      <category>siteground</category>
      <category>postgres</category>
    </item>
  </channel>
</rss>
