# SOLVED: Xibo docker install SQL problem - SQLSTATE\[HY000\] \[2002\] php\_network\_getaddresses: getaddrinfo failed

**URL:** https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224
**Category:** CMS Installation
**Created:** [February 22, 2024, 2:51pm UTC](https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224 "2024-02-22T14:51:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jerry](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://community.xibo.org.uk/u/Jerry)
#### Post date: [February 22, 2024, 2:51pm UTC](https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224/1 "2024-02-22T14:51:36Z")

</div>

To be completed by the original poster:

# CMS Version 3.3.3

# Installation Method

Docker

# Operating System

Ubuntu

# Issue

After trying an upgrade without luck, I tried to rollback.

After restoring the old files and trying to start the installation, it gives me “Fatal Error - sorry this shouldn’t happen.  
SQLSTATE[HY000] [2002] php\_network\_getaddresses: getaddrinfo failed: Try again” in my browser.

When I check the logs, I see the following:

cms-web\_1 | Configuring Database Settings  
cms-web\_1 | ERROR 2005 (HY000): Unknown MySQL server host ‘mysql’ (-3)

I found a topic that also has this problem, but it’s on windows. [Xibo CMS unable accessing mysql docker instance](https://community.xibo.org.uk/t/xibo-cms-unable-accessing-mysql-docker-instance/25027)

Can anyone help me with this? Or at least point me in the right direction?

Thank you so much!

Kind regards

— UPDATE  
I found some more post regarding this problem. I am now trying the solution given here:

> [@Unknown MySQL server host 'mysql'](https://community.xibo.org.uk/t/unknown-mysql-server-host-mysql/31013/5):
>
> OK - I found the solution. I edit the docker-compose.yml file and add a aliases flag for the cms-db service. Now the cms-db Container is linked in the cms-web Container again with “mysql” and everything is working as before. And the reason it took so long for me to find the solution was: I didn’t understand how to access the default network, because the examples I found always mention a concrete docker network. So I missed the keyword “default” and my tries failed. cms-db: image: …

If anyone still has a better idea, please let me know!

Thanks!

---

<div class="post-metadata">

### Author: ![Jerry](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://community.xibo.org.uk/u/Jerry)
#### Post date: [February 22, 2024, 4:51pm UTC](https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224/2 "2024-02-22T16:51:44Z")

</div>

The solution I tried did not work. Does anyone else have a solution for me?

---

<div class="post-metadata">

### Author: ![Jerry](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@Jerry](https://community.xibo.org.uk/u/Jerry)
#### Post date: [February 23, 2024, 9:10am UTC](https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224/3 "2024-02-23T09:10:55Z")

</div>

I solved my problem by adding the following to my cms\_custom-ports.yml

networks:  
default:  
aliases:  
- mysql

---

<div class="post-metadata">

### Author: ![struebig](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@struebig](https://community.xibo.org.uk/u/struebig)
#### Post date: [March 13, 2024, 1:57pm UTC](https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224/4 "2024-03-13T13:57:06Z")

</div>

Sorry, I’m not a regular user of this forum and missed your question.

Actually I also just did an update again and it works perfect with this changes. I hope they do update the docker config sometimes

---

<div class="post-metadata">

### Author: ![system](https://community.xibo.org.uk/uploads/default/original/2X/a/a8759c2d8cc561474733895ac75beeb830f5d8ca.png) [@system](https://community.xibo.org.uk/u/system)
#### Post date: [June 12, 2024, 7:57pm UTC](https://community.xibo.org.uk/t/solved-xibo-docker-install-sql-problem-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/31224/5 "2024-06-12T19:57:38Z")

</div>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.
