1
00:00:04,040 --> 00:00:10,940
We have just successfully created phpMyAdmin with additional environment variable called underscore

2
00:00:10,940 --> 00:00:11,540
host.

3
00:00:11,540 --> 00:00:16,250
And in that variable we have set IP address of the MySQL server.

4
00:00:16,250 --> 00:00:22,490
And finally you have seen that we were able to connect to MySQL database using phpMyAdmin.

5
00:00:22,490 --> 00:00:30,230
And again, main idea here is that we are running phpMyAdmin and MySQL on two different containers.

6
00:00:30,710 --> 00:00:37,820
Please notice that such approach is exactly the same for other containers that you want to connect together.

7
00:00:38,090 --> 00:00:46,280
Now let me get back to two BusyBox containers and explain you concept of the custom networks and explain

8
00:00:46,280 --> 00:00:51,950
you how you are able to communicate between containers using their names instead of IP addresses.

9
00:00:52,070 --> 00:00:58,910
But before doing that, let me quickly take notes of the commands that we have used here for start of

10
00:00:58,910 --> 00:01:03,590
the phpMyAdmin, this command and MySQL container Command.

11
00:01:03,590 --> 00:01:04,440
This one.

12
00:01:04,440 --> 00:01:11,250
And for that, let me go to Visual Studio code here and let me minify this folder and let's create a

13
00:01:11,250 --> 00:01:19,230
new folder called MySQL here near those folders, let's click on new folder icon and here will be MySQL

14
00:01:19,260 --> 00:01:20,130
like so.

15
00:01:20,130 --> 00:01:26,310
And here inside of this folder let me create new file called commands dot txt.

16
00:01:26,820 --> 00:01:33,660
And here let me have a note of those commands that we have used for start of the MySQL container.

17
00:01:33,660 --> 00:01:36,510
Let me copy this command copy.

18
00:01:36,540 --> 00:01:40,050
Go to Visual Studio code and here let me add a comment.

19
00:01:40,080 --> 00:01:46,440
Start MySQL server with custom root password.

20
00:01:47,410 --> 00:01:49,600
Let me hide this pain.

21
00:01:49,600 --> 00:01:51,760
And here, let me paste this command.

22
00:01:51,760 --> 00:01:54,630
And next, let me type.

23
00:01:54,640 --> 00:02:05,980
Start phpMyAdmin with a host variable and let me copy this command from here.

24
00:02:07,340 --> 00:02:09,860
Like so and paste here.

25
00:02:09,889 --> 00:02:10,520
Great.

26
00:02:10,520 --> 00:02:12,650
Here we have two comments on the list.

27
00:02:12,650 --> 00:02:19,790
And with this command we're able to start MySQL server and with this command we're able to start phpMyAdmin.

28
00:02:19,790 --> 00:02:26,120
But basically for better readability, let me split those commands into multiple lines and for that

29
00:02:26,120 --> 00:02:30,800
I could use here Backslashes like so here I could use tab if you want.

30
00:02:30,800 --> 00:02:35,560
And here let's also add backslash and add new line like so.

31
00:02:35,570 --> 00:02:41,090
Again, there is no difference in previous command and in such command because backslash is actually

32
00:02:41,090 --> 00:02:44,000
just a splitter for large command.

33
00:02:44,000 --> 00:02:54,320
And here let's also split this command like so next, split this command as well, and let's add backslash

34
00:02:54,320 --> 00:02:56,720
here and create this command like so.

35
00:02:56,720 --> 00:02:57,170
Great.

36
00:02:57,200 --> 00:02:59,240
Now those commands are more readable.

37
00:02:59,240 --> 00:03:08,430
And here actually let me add comment over Ipaddress, because here we have connected to MySQL server

38
00:03:08,430 --> 00:03:10,200
using is IP address.

39
00:03:10,200 --> 00:03:15,630
And again, that is not the best approach because IP addresses are usually dynamic, they may change

40
00:03:15,630 --> 00:03:20,760
and that's why it is much better to use hostnames for connection between different servers.

41
00:03:20,760 --> 00:03:22,230
It is a general approach.

42
00:03:22,260 --> 00:03:22,620
Great.

43
00:03:22,620 --> 00:03:25,530
Let me save the file and go back to terminal.

44
00:03:25,530 --> 00:03:33,180
Now let me stop those containers, stop this one and actually stop MySQL as well.

45
00:03:33,180 --> 00:03:34,350
Ctrl C.

46
00:03:34,930 --> 00:03:37,810
It seems it doesn't accept the Ctrl key combination.

47
00:03:37,810 --> 00:03:40,220
Probably Q also doesn't work.

48
00:03:40,240 --> 00:03:40,900
All right.

49
00:03:40,900 --> 00:03:43,330
Let me then go to Docker PS.

50
00:03:44,320 --> 00:03:50,560
Docker PS and here use Docker kill and here will be ID of the MySQL container.

51
00:03:50,560 --> 00:03:52,520
And let's prune all containers.

52
00:03:52,540 --> 00:03:54,040
Docker Container.

53
00:03:54,820 --> 00:03:55,450
Prune.

54
00:03:56,700 --> 00:03:57,360
Yes.

55
00:03:57,750 --> 00:03:58,550
All right.

56
00:03:58,560 --> 00:03:59,520
Let's now proceed.

57
00:03:59,520 --> 00:04:03,420
And next, let's get back to two BusyBox containers.

58
00:04:03,420 --> 00:04:08,740
And let me explain you how you are able to communicate over hostnames instead of IP addresses.

59
00:04:08,760 --> 00:04:10,270
I'll see you in the next lecture.

60
00:04:10,290 --> 00:04:10,860
Bye bye.

