[Intro Music]
We have just successfully created
phpMyAdmin with additional
environment variable called
PMA_HOST, and in that
variable, we have set IP address of
the MySQL server. And finally, you
have seen that we were able to
connect to MySQL database using phpMyAdmin.
And again, main idea here
is that we are running phpMyAdmin
and MySQL on two different
containers. Please notice that
such approach is exactly the same
for other containers that you want
to connect together. Now, let me get
back to two busybox containers, and
explain you concept of the custom
networks and explain you how you're
able to communicate between
containers using their names
instead of IP addresses. But before
doing that, let me quickly take
notes of the commands that we have
used here for start of the phpMyAdmin,
this command; and MySQL
container command, this one. And for
that, let me go to Visual Studio
Code, here and let me minify this
folder, and let's create a new
folder called 'mysql' here near those
folders. Let's click on New Folder
icon and here will be 'mysql' like
so. And here inside of this folder,
let me create a new file called
'commands.txt'. And here, let me
have a note of those commands that
we have used for start of the 'mysql'
container. Let me copy this
command. Copy, and go to Visual
Studio Code, and here, let me add a
comment, 'START MYSQL SERVER WITH
CUSTOM ROOT PASSWORD'. Let me hide
this pane. And here let me
paste this command. And next
let me type, 'START PHPMYADMIN WITH
PMA_HOST VARIABLE', and let me copy
this command from here, like so,
and paste here. Great. Here we have
two commands on the list. And with
this commands we're able to start up
the MySQL server. And with this
command, we're able to start phpMyAdmin
But basically for better
readability let me split those
commands into multiple lines, and
for that I could use here backslash, '\'
like so. Here, I could use tab if
you want. And here let's also add
backslash, '\'; and add the newline like
so. Again, there was no difference
in previous command and in such
command because backslash '\' is
actually just a splitter for large
command. And here let's also split
this command, like so. Next, split
this command as well. And let's add
backslash, '\' here, and create this
command like so. Great. Now those
commands are more readable. And
here actually, let me add the
comment, '(over IP address)', because
here we have connected to MySQL
Server using its IP address. And
again, that is not the best
approach because IP addresses are
usually dynamic, they may change.
And that's why it is much better to
use hostnames for connection
between different servers. It is a
general approach. Great. Let me
save the file and go back to
terminal. Now let me stop those
containers, stop this one, and
actually stop mysql as well. 'CTRL+
C'. It seems it doesn't accept the
CTRL+C key combination, probably Q.
Also doesn't work. All right. Let
me then go to 'docker ps'. 'docker ps',
and here use 'docker kill', and here
will be ID of the mysql container,
and let's prune all containers,
'docker container prune'. 'Y'. All
right. Let's now proceed. And next
let's get back to two busybox
containers. And let me explain you
how you're able to communicate over
hostnames instead of IP addresses.
I'll see you in the next lecture. Bye-Bye.
[no audio]