You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker network create wordpress_net
docker network connect wordpress_net wordpress
docker network connect wordpress_net mariadb
5d9697c2a030a4469c2dedbe8be0541d4022a6545c036fa42a335be319dc05bf
root@ip-172-31-19-232:~# docker exec wordpress mysqladmin -h mariadb -u root -ppassword ping
mysqld is alive
root@ip-172-31-19-232:~# exit
admin@ip-172-31-19-232:/$ cat ~/agent/check.sh
#!/usr/bin/bash
res=$(sudo docker exec wordpress mysqladmin -h mysql -u root -ppassword --connect-timeout 2 ping)
res=$(echo $res|tr -d '\r')
if [[ "$res" = "mysqld is alive" ]]
then
echo -n "OK"
else
echo -n "NO"
fi
admin@ip-172-31-19-232:/$ ~/agent/check.sh
mysqladmin: connect to server at 'mysql' failed
error: 'Unknown MySQL server host 'mysql' (-2)'
Check that mysqld is running on mysql and that the port is 3306.
You can check this by doing 'telnet mysql 3306'
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: