Articles in this section

Unable to start MariaDB 10.6 on a Plesk server: Bind on TCP/IP port. Got error: 22: Invalid argument

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • After upgrading MariaDB to 10.6, 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

Cause

MariaDB 10.6 does not allow to bind both ::1 and 127.0.0.1 via the setting bind-address = ::ffff:127.0.0.1 in the file /etc/my.cnf.

Resolution

  1. Connect to the Plesk server via SSH.
  2. Open the file in a text editor. In this example, we are using the vi editor:

    # vi /etc/my.cnf

  3. Change the bind-address setting from:

    CONFIG_TEXT: bind-address = ::ffff:127.0.0.1

    to

    CONFIG_TEXT: bind-address = 127.0.0.1

  4. Save the changes and close the file.

  5. Start the MariaDB service:

    # service mariadb restart

Was this article helpful?

Comments

2 comments
Date Votes
  • 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. 

    3
  • 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 ...

    0

Please sign in to leave a comment.