All right.
So to start the installation process, we'll go to the MySQL website.
There's a link as a resource attached to this video, and then we'll go to downloads and click on the
community download section.
We don't need any of the fancy stuff, community downloads.
And then specifically what we want is the community server.
So for Mac, there's a fancy installer, but for Windows rather for Mac there is not.
So we have to install it.
It still is very easy, but we don't get everything all bundled together.
Make sure you click the installation download that matches your architecture for your Mac.
So I'll click download.
We can click.
No thanks.
We don't want to sign up.
We don't need to sign up.
And then hopefully that finishes up.
Launch the little installer here and my Mac is going to complain to me that it doesn't trust it, so
I have to go to my system preferences.
Go to the security and privacy pane and then click open anyway.
Which you can see right here.
Open anyway.
Type my password in, do all that stuff.
And then it should open the installer.
Okay, so now that's done.
At least the installer is open and I'll click continue, scroll through the terms.
Agree.
And then click install.
You will need a decent amount of space, 700 and something gigs.
I have to type my computer password or at least my account password.
And it doesn't take all that long.
I'll leave that option checked.
Click next.
Now, this is very important.
We need to set up a password for the root user.
Now, this can be whatever you want, but you need to remember what it is because you're going to have
to enter it later in this video.
So put some password in there.
It doesn't have to match your computer password, whatever you want.
Root user is the top level main user of your SQL Server, so you can change that password, but remember
what you put in there.
And then it's asking me for my Mac, my computer password.
Again, that's not my SQL password.
And then that should finish.
Soon.
There we are.
We'll click close and we have installed the server.
All right.
So the next thing we're going to do, it's installed.
That's it.
But now we need to actually try using the command line client.
So what I'm going to do is open up my terminal.
I'm just gonna use the basic terminal app.
Now, if you have some other terminal app you like to use, you can use that instead.
Here's mine.
It might look a little bit different than yours, but it doesn't matter.
All right, so now let's test the install out.
We're probably going to have a bad time if I try running the command.
My SQL, that is the command will use to open up the MySQL interactive shell.
It tells me command not found.
Now, that doesn't mean it wasn't installed.
It just means that we're not able to reference it.
We're not able to execute the program simply by running my SQL.
What we need to do is a little annoying if you don't have any experience with Terminal, but I'm going
to give you the commands you need to run.
Basically, we need to tell our terminal about the MySQL program, where to find it, and the way that
we do that is by opening a particular file.
Now type this carefully and also just copy and paste if you prefer tilde slash and then dot bash pro
file.
So this is a file that likely already exists on your machine.
Now it's going to look different than what I have here, and that doesn't matter.
It might be empty.
And if it doesn't exist at all and you've got an error that's also OC, all you would do is run this
command first and again I'll have these written out for you so you don't have to type them yourself.
Touch this particular thing called the bash profile.
It's a file that will make the file and then you can open it.
So I already have one.
I open it and all I'm going to do is put this very important line of code at the bottom.
Export path equals the current path usr local MySQL bin.
We're basically saying add in this thing called MySQL, we've already installed it and I'm going to
save and close this file so I know this all feels a bit tedious.
It is.
Which is the reason.
Initially when I made this course I didn't have students do this, but the tools that we used back then
no longer exist.
So I'm here redoing it.
So now that I have that done, what I can do is open up a new terminal window.
There we go.
And I should be able to type my SQL and I get a different error.
But this is a good error.
This error says access denied for this user and that is a MySQL error.
The error we got previously was just the terminal saying, I don't know what you're talking about with
my SQL here.
My SQL is saying, Yeah, you don't have the right password, I can't log you in.
So that's good.
And the truth is we're not going to be using my SQL on its own the way that we're going to start up.
My SQL is exactly like this, my SQL dash, you root.
This says we're logging in as the user that's with the you is root.
And if you remember when we installed it a couple of moments ago, we also had to provide a password.
So we add this dash P and then hit enter and then our prompt will change.
And it's asking me now to type the password I set up for the root user.
So whatever user I specified, we only have one user.
It's kind of complicated when you're starting out, but remember we set up a password for the root user.
You didn't have a choice.
So type that password and hit enter.
And hopefully it works.
And if it does work, you'll see something like this a different prompt.
It says MySQL here you can type things and get errors.
Here's a MySQL error.
We're not going to learn much in this video, but if you want to get out of here, type quit followed
by a semicolon and then it just says bye.
So one more time.
My SQL on its own probably not going to work for you, but if we do dash you route, that's saying we're
logging in as the root user.
That's also not going to work because I didn't provide a password.
But then the dash P at the end says, I'm going to provide you a password and then it asks me to enter
the password immediately and I won't see what I'm typing.
Right.
That's the whole reason it's set up this way.
Instead of having you provide your password like right here afterwards, anybody could look at that
in your history, you would be typing your password in text as part of the command.
So instead your cursor goes into this mystery mode and I didn't type my correct password, but I'll
type it correctly and you can change this password, but you should just use the password you previously
set up when we actually ran the installer.
Okay, So that is the basic process now for when you're following along in this course, I would honestly
just leave this open in a terminal window, have your MySQL prompt open here and you can run all the
different commands I'm going to show you.
You can log out, right?
You can quit and then you'll just have to come back any time you're doing the course.
And just remember the MySQL dash, you root dash P it's not a big deal, but if you're really jamming
through the course, just leave it open and that should be pretty much it.
Whew.
Okay, we got that installed.
I hope so.
Now we're going to install the workbench, which just to remind you, my skill workbench is a graphical
interface where we can write queries, execute them without having to work with the command line.
So it looks I already have it installed, but it looks like this on Windows.
This is the Windows version and here's the Mac version.
I already showed you this, right?
I write my query, I can run it.
There's a lot more you can do as well.
You can interact with databases, you can manage the databases here at different tables.
You can create tables.
We're going to learn about all this stuff, how to do it through SQL queries and SQL commands.
Long story short, we want to install this and it is called my SQL Workbench.
There's a link included along with this video to the download page, and then we'll click on the download
button.
Now if your particular architecture or operating or your version of Mac OS is not supported, I'll have
a workaround for you in a moment, but I'm going to click download.
We don't need to sign up or anything.
Just start my download and then we'll drag that to applications.
Wait for that to finish transferring or copying.
I'll go to my applications and it should be in here and I'll open it up.
There it is.
And then once it opens, there's already a connection in place.
I can click that and then I need to type in the root password that I set up when I just installed my
SQL a couple of minutes ago and now I'm in.
I made the font a little bit bigger and now we can try just to make sure that it's working.
We'll do something silly like 99 plus one.
So if we write, select 99 plus one, we'll learn all about select.
That's like half the course and then a semicolon, and then I click the lightning bolt.
We should see 100.
And that's done through the my SQL Server behind the scenes.
This is just the front end or the client.
Okay, So we have the workbench installed and you can use this at any point in the course.
All of the code, all of the queries I show you will work in the workbench.
Now for some reason you are not able to install my SQL.
Let's say it doesn't support your version of Mac OS or your particular architecture of your machine.
There are many alternatives, many database clients that work with my SQL.
The workbench is just one option, so DB gate is one that I can recommend.
At least as of right now, these things change so quickly.
Who knows?
In a couple of months there might be something better.
This one might just not even exist.
But for now this is a good option.
You can click download if you need it.
Now.
I don't really recommend going out of your way to install it unless my SQL workbench didn't work for
you.
So I'm going to open that up and then when you open it up, yours might look a tiny bit different because
I change the font and the color, the background here, but basically it will look something like this
where it is made to work with different connections, different databases, not just my SQL.
So you will have to set up a connection, just close everything here that is a MySQL connection, not
PostgreSQL not list, but my SQL and then we'll have it on local host 3306 is the default port, so
just leave that there and the user that we're logging in in as is root.
And that password here needs to be the root password that you set up for my SQL.
And then you can test your connection here by clicking test if you see connected.
I've already entered my password in the past.
You're good to go.
You can then click connect and you should momentarily see that it says connected and it says We're on
local host.
Now I can click the plus sign and write some basic code in here, like select 99 plus one, and then
I can run it by going to execute using command, enter or right clicking execute.
And there we are.
We see 100 right there.
Okay, So again, this is just an option.
You can use it instead of the workbench if you prefer.
I would stick with the workbench unless it doesn't work and then you can use DB gate.
DB Gate is set up to work with many databases, so you just have to make sure you're using the MySQL
connection type and that is it I believe, for installing on a mac.
So here's the workbench, here's my terminal, here's DB gate.
All of these are going to allow me to run the code in this course.
Next up, we're going to start doing some of that.
We're going to run some code.