1
00:00:01,150 --> 00:00:01,810
Welcome back.

2
00:00:02,200 --> 00:00:06,970
Now what we need to do is that we need to connect to the database, we need to connect to my database.

3
00:00:07,600 --> 00:00:10,270
And the first step is that you need to open up my eyes.

4
00:00:10,480 --> 00:00:15,880
You need to open up a zone and then you need to start mining SKU database and the Apache web server.

5
00:00:16,150 --> 00:00:17,870
So this is the first step you need to open up.

6
00:00:18,820 --> 00:00:25,120
And then you need to man and you need to click on manage server or servers and then start the Apache

7
00:00:25,120 --> 00:00:27,520
Web server and then my squirrel database.

8
00:00:27,910 --> 00:00:34,030
And then you need to open up the localhost between my admin, go to local hospitals, between my admin.

9
00:00:34,420 --> 00:00:35,830
And this is the first step.

10
00:00:36,340 --> 00:00:40,330
The second step is that now we need to connect to.

11
00:00:41,350 --> 00:00:44,800
We need to connect to my external database using Python.

12
00:00:45,100 --> 00:00:47,530
So I'm going to open up my project.

13
00:00:47,530 --> 00:00:52,660
And then in the project, the first step that we need to do is that we need to import minus squirrel

14
00:00:52,660 --> 00:00:53,230
connector.

15
00:00:53,590 --> 00:00:56,560
So add it up at the top of the script you need to say.

16
00:00:58,000 --> 00:01:00,460
You need to say at the top import.

17
00:01:01,470 --> 00:01:08,490
Import and then my is que il dock connector connector.

18
00:01:09,660 --> 00:01:10,620
So this is the first step.

19
00:01:11,460 --> 00:01:17,220
This is the second step, the third step is that we need to connect to the database, so in order to

20
00:01:17,220 --> 00:01:20,790
connect to the database, we need to use my serial connector.

21
00:01:21,120 --> 00:01:21,900
So I'm going to say.

22
00:01:23,570 --> 00:01:33,300
Ma'am, I'm going to have to eat a valuable gold mine database is equal to my askew ill connector connector.

23
00:01:33,770 --> 00:01:36,530
And then I'm going to call a function called Connect.

24
00:01:38,570 --> 00:01:39,620
My school.

25
00:01:40,600 --> 00:01:44,890
That connector that connects.

26
00:01:46,310 --> 00:01:46,710
One.

27
00:01:48,660 --> 00:01:50,790
And then this function takes.

28
00:01:51,910 --> 00:01:59,020
This function, the Connect function, takes four parameters, the first parameter is the host, so

29
00:01:59,500 --> 00:02:01,820
how can we get the credentials?

30
00:02:01,840 --> 00:02:03,430
How can we get the database credentials?

31
00:02:03,610 --> 00:02:05,350
Well, you need to open up again.

32
00:02:05,360 --> 00:02:13,780
You need to open up localhost beach Beachbody, my admin, and then you need to click on user accounts.

33
00:02:14,140 --> 00:02:17,050
And then in the user accounts, you will find so many credentials.

34
00:02:17,410 --> 00:02:21,430
The one that I'm going to be using is this one because it's the easiest one, the last one.

35
00:02:22,180 --> 00:02:26,770
So the user name is root, the host name is localhost.

36
00:02:27,340 --> 00:02:32,350
The password is nothing, and the global privileges is all privileges.

37
00:02:33,100 --> 00:02:37,210
And the database name is remember, the database that we created is called Python.

38
00:02:37,840 --> 00:02:39,820
So let's use these credentials.

39
00:02:40,210 --> 00:02:45,400
So in the in the code, what I'm going to do is that I'm going to pass these four parameters.

40
00:02:45,430 --> 00:02:53,350
The first parameter is the host, so we need to say host host is equal to and then double quotes and

41
00:02:53,350 --> 00:02:57,430
then local hosts and then comma.

42
00:02:57,940 --> 00:03:00,340
And then the second parameter is the user name.

43
00:03:01,120 --> 00:03:03,990
So the user name, the user name is root.

44
00:03:04,000 --> 00:03:08,440
So we need to say here user is equal to root.

45
00:03:10,760 --> 00:03:14,420
The third the third parameter is the password.

46
00:03:14,450 --> 00:03:20,170
So we need to say password is equal to and the password is nothing.

47
00:03:20,270 --> 00:03:25,820
There is no password, so we need to say double quotes, empty double codes and then comma and they

48
00:03:25,820 --> 00:03:27,950
will last parameter is the database.

49
00:03:28,400 --> 00:03:31,190
So the database was named Python.

50
00:03:31,250 --> 00:03:33,590
So we need to say a database.

51
00:03:36,280 --> 00:03:39,530
Is equal to and then, Michael.

52
00:03:40,200 --> 00:03:40,850
But that's it.

53
00:03:40,870 --> 00:03:46,840
Now we can't connect to the database using this, my database, and this is crucial.

54
00:03:47,080 --> 00:03:49,240
You need you need to.

55
00:03:50,530 --> 00:03:56,830
You need to get this right because if you get this wrong, it is not going to work because this is crucial

56
00:03:58,450 --> 00:04:01,390
in our application and this is going to allow us to continue.

57
00:04:01,390 --> 00:04:06,670
And this is going to allow us to connect with a database and do all sorts of sorts of things with our

58
00:04:06,670 --> 00:04:07,120
database.
