Hi-ya, folks!
My friends, how are you doing today?
Greetings from a small space!
For today my dear brothers and sisters, a task from our smart teachers at Kode Kloud reads about putting up or implementing, and configuring a PostgreSQL database.
Now my friends, a database is something that lets us store all kinds of information. Usually, for reliable and fast retrieval later on.
And PostgreSQL is one of the ways, or software that lets us implement, configure, and persist data and turn it into information, through means of a database service, or instance.
Okay, folks?
Alright.
Let’s get started.
We’ve cleared our task earlier, now we’ll begin with this task.
Folks, let’s work on this one next.
We have the following task briefing from our good friends at Kode Kloud academy.
The
Nautilus
application development team has shared that they are planning to deploy one newly developed application onNautilus
infra inStratos DC
. The application uses PostgreSQL database, so as a pre-requisite we need to set up PostgreSQL database server as per requirements shared below:PostgreSQL database server is already installed on the
Nautilus
database server.a. Create a database user
kodekloud_joy
and set its password toksH85UJjhb
.b. Create a database
kodekloud_db1
and grant full permissions to userkodekloud_joy
on this database.
Note:
Please do not try to restart PostgreSQL server service.

Okay, let’s work together to figure this one out, alright my friends?
Good stuff.
We’re told to create a database record, off an existing database instance.
Okay, first, we need to access our database server.
ssh peter@stdb01
Enter the server password. That can be found off this table:

Alright, we’re in.
Next, we need to start to add a database record with the details given to us from the briefing.
Wait up… We slow down.
Folks, I don’t know how to do this, okay? Let me first try to do a little learning further, alright?
Then, I’ll return here – hopefully, with something to share with good meaning and, yes, I hope we make some progress going forward.
Okay.
I asked a chatbot to help me. And it helped a lot, folks.
Thank God.

Remember, that first we need to SSH into our database server. Yes?

Then, we also need to check if Postgres is working fine, on our Linux instance.
However, I fumbled around and made a bunch of mistakes, not knowing what the service name of postgres is on our database server.
Sorry folks, it’s not all the time that I get to work with it.

And then, we finally access the postgres command line prompt. Which allowed us to do necessary database record creation and privilege adjustments.
My friends, here are the Postgres prompt commands necessary:
sudo su - postgres
psql
This tells Linux that we need to access the context that lets us work with Postgres.
CREATE USER kodekloud_joy WITH PASSWORD 'ksH85UJjhb';
We create the database user “kodekloud_joy” with the password defined.
CREATE DATABASE kodekloud_db1;
Next, folks since a database user needs a database. We create a database with name “kodekloud_db1”.
GRANT ALL PRIVILEGES ON DATABASE kodekloud_db1 TO kodekloud_joy;
Finally, we tell Postgres that we’re letting user “kodekloud_joy” access the database named “kodekloud_db1”. With the necessary privileges.

Our Kode Kloud task correctness checker shows we’ve done our task for Day 17 well enough.
Good job!!
Good work, team! 🤟🤟🤟

Alright, see you folks next time. Okay?
Thank you.
Leave a Reply