Applicable to:
- Plesk for Linux
Symptoms
-
After upgrading MariaDB version to 10.6 or higher, the service fails to start with:
# service mariadb status
...
mariadbd[32685]: 2022-04-19 6:41:28 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 22: Invalid argument
mariadbd[32685]: 2022-04-19 6:41:28 0 [ERROR] Do you already have another server running on port: 3306 ?
mariadbd[32685]: 2022-04-19 6:41:28 0 [ERROR] Aborting -
Plesk is not accessible:
PLESK_INFO: 500 Plesk\Exception\Database
DB query failed: SQLSTATE[HY000] [2002] No such file or directory - Websites that use databases are not accessible.
Cause
The bind-address value in the MariaDB my.cnf configuration file was set to bind-address = ::ffff:127.0.0.1 prior to the upgrade and was not changed by the upgrade tool. Starting from version 10.6, MariaDB does not allow to bind both ::1 and 127.0.0.1 via the setting bind-address = ::ffff:127.0.0.1 in MariaDB configuration file /etc/my.cnf.
This is MariaDB bug MDEV-34191 originating from packaging changes on Debian-based systems which causes the package upgrade to restart MariaDB prematurely before configuration is updated.
Resolution
- Connect to the Plesk server via SSH.
-
Open the file in a text editor. In this example, we are using the vi editor:
# vi /etc/my.cnf
-
Change the
bind-addresssetting from:CONFIG_TEXT: bind-address = ::ffff:127.0.0.1
to
CONFIG_TEXT: bind-address = 127.0.0.1
- Save the changes and close the file.
-
Start the MariaDB service:
# service mariadb restart
-
Upgrade the databases:
# mysql_upgrade -u admin -p`cat /etc/psa/.psa.shadow` --force
Comments
In my case, the my.cnf file was located in the /etc/mysql folder and not /etc/. By the way, this information or at least a link to this information should be included in the How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.x on Linux? support page instructions at step 5 or 6. I'm lucky I located this article and my server was down for a good while as I frantically searched around to figure what the heck went wrong.
Thanks to Wyk Parish my update failed because of this error too. It is absolutely mandatory to check this before the upgrade. I shit my pants as the update failed ...
Please sign in to leave a comment.