Check out a free preview of the full Full Stack for Front-Ends Part 2 course:
The "Exercise: MySQL Installation" Lesson is part of the full, Full Stack for Front-Ends Part 2 course featured in this preview video. Here's what you'd learn in this lesson:

In this exercise, Jem installs and tests MySQL server on the example web server.

Get Unlimited Access Now

Transcript from the "Exercise: MySQL Installation" Lesson

[00:00:00]
>> Jem Young: So we can get to this exercise with MySQL. You don't have to do it, this is totally optional, because we are not actually going to do much with MySQL. Again, SQL is a totally different class. We could do a week on it and not even touch much of it.

[00:00:14] But I want to make sure you know how to install database with the same defaults we want to use. And if you are saying why am I saying sequel instead of SQL, totally where you went to school, where you are from. Some people say SQL, some people say sequel, it doesn't really matter.

[00:00:27] I say SQL, that is just how I learned it. Just in case, some of you are confused, like what about SQL, I have heard about that. It is the same thing. So if you want to install SQL, say apt install mysql-server. Pretty standard. The great thing is now SQL has a script to do a secure installation.

[00:00:45] So you can say mysql_secure_installation and it kinda runs through some sane defaults, makes you pick a root password, things like that. A word on databases, databases are a common source of vulnerability for most servers. Because at it's core that's where all your knowledge is. That's where all the data is.

[00:01:06] That's where people wanna get into. So there's some useful tips that I put on the next slide, as soon as we're done installing MySQL. But in general, be very, very cagey with your database, I see people install them, just kind of really nearly they don't put a password on it, they expose it out to the Internet, just bad practices all around.

[00:01:25] Just be very very careful cuz your database is where like all your business logic lies, whether it's credit cards and passwords and things like that. So be very cautious, so I'm gonna go ahead and run this. Again, this is optional exercise just for the sake of knowledge. But I'm gonna install SQL server.

[00:01:43] Says sudo apt install mysql-server.
>> Jem Young: All right, and as soon as secure installation for me, which is great. So I'm gonna give the root password. I'm just gonna give it a simple one.
>> Jem Young: All right, we are good. I might run mysql_secure_installation, but I don't think we have to now with this particular install of mysql.

[00:02:32] But if you're running this in the future, some later date, if it didn't ask you for a root password, you should just run the mysql_secure_installation script. Just a FYI. So let's go and log in to mysql just to make sure it's up and running. Say that, we just say mysql -u.

[00:02:49] Log in as roots -p. It's gonna ask me for a password. And we're in mysql. So I think we can say show databases.
>> Jem Young: Semicolon, and just showing the databases we have. Just some defaults in there.
>> Jem Young: But we now how SQL up and running. We have a password on it.

[00:03:19] And after this, we're going to run some standard, just set up, just standard checks to make sure we know what is going on. And if you are in mysql console, you have to end everything with a semicolon, otherwise, as I'm sure some of you just learned you will not run anything, it will just kind of error out.

[00:03:42]
>> Jem Young: Exit and I'm just gonna exit out of here. So everybody is good so far? We've got SQL running up and nothing particularly special about this. This would be the same for post grads, for any other kind of SQL database you wanna run. The non-relational database will be a little bit different, but the concepts still apply.