Mysql bind address multiple

Keywords: LAMP/MAMP/WAMP - AWS - How to - Services (Apache, MariaDB, MySQL…)

Description:
Hi,

My my.cnf file has an entry bind-address=127.0.0.1 which is fine and I can use this without issues. There is now a requirement to bind it on another IP adress. I tried this – bind-address=127.0.0.1,18.131.14.12. However, when I try to restart mysql it fails and doesn’t start. If I revert back, mysql starts fine.
Do you know how can I properly bind mysql to multiple addresses?

Hello @ubay25,

What version of our LAMP stack are you using? I think MySQL 8.x introduced the option to bind multiple IPs defining it as you said. We have a Support Tool that will gather relevant information for us to analyze your configuration and logs. Could you please execute it on the machine where the stack is running by following the steps described in the guide below?

Please note that you need to paste the code ID that is shown at the end.

Regards,
Francisco de Paz

Hi, many thanks for your reply. Please find the code below.

261b181e-a23f-54f1-f53d-f8118aa9b134

The version of MySQL on my aws lightsail instance is v8.0.18, so I assumed it supports the option to bind multiple IPs. However, mysql fails to start if I have more than 1 IP on the bind-address variable.

Any advise would be appreciated, thanks!

Hello @ubay25,

There are some errors in your DB logs:

2021-09-22T18:22:05.276911Z 0 [Warning] [MY-011068] [Server] The syntax 'expire-logs-days' is deprecated and will be removed in a future release. Please use binlog_expire_logs_seconds instead.
2021-09-22T18:22:05.282317Z 0 [System] [MY-010116] [Server] /opt/bitnami/mysql/bin/mysqld.bin (mysqld 8.0.18) starting as process 4324
2021-09-22T18:22:07.018429Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-09-22T18:22:07.024053Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Cannot assign requested address
2021-09-22T18:22:07.024213Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2021-09-22T18:22:07.024552Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-09-22T18:22:08.270896Z 0 [System] [MY-010910] [Server] /opt/bitnami/mysql/bin/mysqld.bin: Shutdown complete (mysqld 8.0.18)  MySQL Community Server - GPL.

It seems this is an issue with MySQL itself and we are not really knowledgeable on it. Moreover, we have replaced MySQL with MariaDB as the database from LAMP. Could you check whether this works on the newer LAMPs?

Regards,
Francisco de Paz

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