1 00:00:00,480 --> 00:00:03,750 So the first thing we have to cover is making databases. 2 00:00:03,750 --> 00:00:09,860 We have to have some databases before we can then put stuff anywhere inside of those databases. 3 00:00:09,870 --> 00:00:15,150 So it's a couple of steps that we need to go through before we can even really work with real data. 4 00:00:15,150 --> 00:00:20,310 But this is a really important piece of using my SQL or really any SQL database. 5 00:00:20,580 --> 00:00:26,370 So we've got our database server that's already installed and set up and within the world of a database 6 00:00:26,370 --> 00:00:29,310 server, we can have a bunch of different databases. 7 00:00:29,310 --> 00:00:36,000 So these are self contained sort of silos of information, silos of data and tables, which we'll learn 8 00:00:36,000 --> 00:00:36,900 about shortly. 9 00:00:36,960 --> 00:00:39,300 And they have nothing to do with one another. 10 00:00:39,330 --> 00:00:45,960 It's important to know that our data isn't all floating around together in one soup, but rather it's 11 00:00:45,960 --> 00:00:51,750 divided up into these discrete databases so we can have a dog walker database, a new site database, 12 00:00:51,750 --> 00:00:55,410 just a practice database if you're trying things out and they're all separate. 13 00:00:55,410 --> 00:01:01,230 So let's zoom in on just to dog Walker database and a soap shop database. 14 00:01:01,230 --> 00:01:04,530 So we have a dog walking app and a soap e commerce store. 15 00:01:04,530 --> 00:01:08,310 I guess both of these will have some data that is unique to them. 16 00:01:08,310 --> 00:01:14,820 So we'll have some dog stuff, dog profile walkers, something like that inside of the dog Walker database. 17 00:01:14,820 --> 00:01:18,930 And we'll have a soaps set of information in the soap shop database. 18 00:01:19,140 --> 00:01:25,080 But they also might both have users, they might both have payments, but we want them to be separate, 19 00:01:25,080 --> 00:01:25,290 right? 20 00:01:25,290 --> 00:01:31,980 We can't have contamination where all of a sudden we're charging people in the dog walker database when 21 00:01:31,980 --> 00:01:34,230 they buy soap or vice versa. 22 00:01:34,230 --> 00:01:38,760 We want to have each set of data in its own little bubble. 23 00:01:38,760 --> 00:01:40,770 So that's what we call a database. 24 00:01:40,770 --> 00:01:46,650 So one more time we have multiple databases within a MySQL database server. 25 00:01:47,040 --> 00:01:53,610 So the first thing we need to do as far as code is take a look at what database is currently exist. 26 00:01:53,610 --> 00:01:59,010 When you install my SQL, there will be some default databases you probably won't need to touch them 27 00:01:59,010 --> 00:01:59,760 at all right now. 28 00:01:59,760 --> 00:02:01,680 Well, you definitely won't need to right now. 29 00:02:01,680 --> 00:02:08,880 But this command show databases, we've actually seen it briefly when we installed this will show us 30 00:02:08,880 --> 00:02:09,870 those databases. 31 00:02:10,080 --> 00:02:16,890 So I'm going to flip between using the terminal and workbench in this video just to make sure we cover 32 00:02:16,890 --> 00:02:17,730 all the bases. 33 00:02:17,730 --> 00:02:20,430 The first thing we'll do is fire it up in the terminal. 34 00:02:20,430 --> 00:02:24,690 So again, this command is my SQL view and then I'm logging in as root. 35 00:02:24,690 --> 00:02:26,280 That's the only user we have right now. 36 00:02:26,430 --> 00:02:28,470 And then I'm going to provide a password afterwards. 37 00:02:28,470 --> 00:02:32,370 Dash P So I need to provide the root password that I set up. 38 00:02:34,070 --> 00:02:35,060 And I hit enter. 39 00:02:35,060 --> 00:02:37,180 And if I have the right password, this is what I see. 40 00:02:37,190 --> 00:02:41,570 Now I'm going to clear my screen with control l just so you don't have to look at all this text. 41 00:02:41,750 --> 00:02:44,390 And my prompt has changed to my SQL. 42 00:02:44,660 --> 00:02:50,360 So I type stuff in here and I am in my SQL and I get an error because that doesn't mean anything to 43 00:02:50,360 --> 00:02:51,320 my SQL. 44 00:02:51,320 --> 00:02:59,540 But this should, if I do a show databases with a semicolon, if I don't have that semicolon, you'll 45 00:02:59,540 --> 00:03:00,920 see that I get this arrow. 46 00:03:01,490 --> 00:03:02,630 It's asking me. 47 00:03:02,630 --> 00:03:03,470 It's kind of waiting. 48 00:03:03,470 --> 00:03:05,090 It's like, okay, and then what? 49 00:03:05,090 --> 00:03:10,460 You haven't terminated your command, but a semicolon tells my SQL, this is the end. 50 00:03:11,450 --> 00:03:12,470 So what do we see? 51 00:03:12,470 --> 00:03:18,230 We get this printout that says, Here are the databases you have right now, Information schema, my 52 00:03:18,260 --> 00:03:19,820 SQL performance schema. 53 00:03:19,820 --> 00:03:25,370 Sis, you really don't need to worry about these, but the fact that we see something tells us databases 54 00:03:25,370 --> 00:03:26,140 exist. 55 00:03:26,170 --> 00:03:33,380 That's kind of all you need to know now over in the workbench to log in to connect to the database. 56 00:03:33,380 --> 00:03:35,420 I have this local instant connection. 57 00:03:35,420 --> 00:03:37,680 I have to provide my password here, right? 58 00:03:37,700 --> 00:03:42,830 Because the whole point is that we're doing this with a graphical interface, not via the command line. 59 00:03:42,830 --> 00:03:44,990 And then what I can do is run this command. 60 00:03:44,990 --> 00:03:46,100 I'm going to type. 61 00:03:46,130 --> 00:03:52,280 Unfortunately, it can't make this much larger show databases semicolon, and I'm going to click that 62 00:03:52,280 --> 00:03:53,210 lightning bolt. 63 00:03:54,480 --> 00:03:56,310 And I get a result back. 64 00:03:56,310 --> 00:04:01,390 And it's the same information, the same data it's just displayed in this app, right? 65 00:04:01,410 --> 00:04:03,750 Information schema, my SQL performance schema. 66 00:04:03,750 --> 00:04:07,640 So this same thing here, just two different ways of accessing that. 67 00:04:07,650 --> 00:04:09,750 Now, this is not that exciting at the moment. 68 00:04:09,750 --> 00:04:15,570 Not at all exciting because we don't have any new databases and that's going to change in the next video.