Now we did install MySQL.
The MySQL software in the previous lectures.
And of course, that is all you need.
You don't need to install multiple servers.
But in this course, we wanna show you examples
for both MySQL and PostgreSQL
because as mentioned,
generally the SQL syntax will be the same,
but sometimes there are subtle differences,
which we also want to highlight,
and therefore we will use both MySQL and PostgreSQL.
And you can, of course, also use both,
though one of the two is enough,
or none of the two, if you just wanna watch the videos
and to not execute the commands on your own,
which of course also would be fine.
In this lecture, we're now going to install PostgreSQL.
We're going to install PostgreSQL for Mac OS.
In the next lecture, just as before with MySQL,
we're going to install PostgreSQL for Windows.
If you do want to install PostgreSQL,
you can start by searching for PostgreSQL installation,
and you should find this download page on postgresql.org.
Just as for MySQL,
a link to this page will also be attached to this lecture.
Now, here you can choose installers
for different operating systems.
And again, I'll start on Mac OS,
and then here, I'll click on download the installer.
Now on this page, I got again, various operating systems
and various versions of PostgreSQL
and you can simply choose the latest version
for your operating system in my case, Mac OS,
and it'll download that.
So now this download starts,
and it can take a couple of seconds,
and thereafter we'll walk through that installer
to install PostgreSQL on our system.
Now, the download finished for me.
So I'll will now execute this installer.
And at the beginning, I have to enter my password here,
my Mac user password. So I'll quickly do that.
And this does now install the PostgreSQL server,
and also the PostgreSQL client, the shell client.
So this command line tool.
This will both be installed in one step.
I'll click next here.
I'll keep the default installation directory.
And here we can now choose what should be installed.
And again, I'll install the command line tools
and PostgreSQL server.
And I'll also install the other tools here.
Click next, keep that default for the data directory.
So that's the directory where the data will be written to,
the actual database data.
Because again, the database is just software
that manages the storage of data.
Ultimately it will still be stored on the hard drive
and that's the folder where it will be stored.
And then I'll click next.
And now just as with MySQL,
if you follow through the installation of that,
we have users for this PostgreSQL server,
because not everyone should be able to connect
to the database server,
because we have data on there that should be protected,
and therefore as part of the installation,
a default user is set up for that database server,
and it will have a name of postgres.
So that is the default user's name.
And you have to choose your password now for this user.
For MySQL the name was root, by the way.
For PostgreSQL it's postgres.
That's something to keep in mind.
And now I'll choose a password here.
And for convenience, I'll use the same one as I chose
for MySQL and click next.
And now you can choose a port number.
Now that is the port number that will be used
by this PostgreSQL server.
And that is the port number that has to be used
for connecting to that server.
And I'll stick to that default here.
For MySQL the default was 3306.
For PostgreSQL it's 5432 here.
I'll keep that default and click next.
Now, here we can keep the default, click next again
and click next, so that now after clicking next again,
everything is installed and configured.
So let's wait for this installation to finish now.
And the installation did finish for me here
and now all uncheck this here, this Stack Builder thing,
and click finish.
Now with it installed,
you should be able to go to your applications in your finder
and there under P, you should find your PostgreSQL,
and then whichever version you chose, folder.
And in there, you've got various tools.
For example, pgAdmin 4.
If you double click on that, you will start a tool
that allows you to administrate this SQL server.
Now, when you start this pgAdmin tool
for the first start, you're asked to set a password
for a user for this pgAdmin tool.
So that's not your database server user,
but a specific user for this administration tool.
And I will set a password here.
And now here,
you will be able to start new PostgreSQL servers.
Here on the left,
you actually should have one server already,
and now I'm prompted to enter the password
for that postgres user on that server,
which we chose during the installation.
And then here you can, for example, remove that server
and change to server configuration
though, at the moment, I'm absolutely fine with it,
and therefore, I'll just close this tool
and leave it like this.
Now, we also got this SQL Shell,
which we can double click,
and this will then give us this command line client,
which connects to this running database server,
which can be used for sending commands to it.
But again, that is something we'll see later.
So for now, I'll just close this and terminate this session.
And that was the installation of PostgreSQL for Mac OS.
Let's now install it for Windows.