phpmysqlmariadbupgrademariadb-10.5

MariaDB upgrade from 10.5 to 10.6: mysqli::real_connect(): (HY000/2002): No such file or directory


I have a MariaDB 10.5 instance running on a OpenSUSE Leap 15.3 server (PHP 7.4.6).

I'm not able to follow the official upgrade documentation for the installation was made through official SLE repositories (last available version still being 10.5) and not from MariaDB one. Then, here is what I have achieved so far:

rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

sudo zypper addrepo --gpgcheck --refresh https://yum.mariadb.org/10.6/opensuse/15/x86_64 mariadb

sudo zypper install MariaDB-server MariaDB-client

I then get the right version using mariadb --version.

I'm now able to connect to mariadb locally using mariadb -u root -p and to list my databases.

Issues are:

mysqli::real_connect(): (HY000/2002): No such file or directory

PHP Warning: mysqli::real_connect(): (HY000/2002): No such file or directory in /var/www/glpi/src/DBmysql.php on line 248 A link to the SQL server could not be established. Please check your configuration.

Something was broken when reinstalling MariaDB and I can't find out where...


EDIT:

Here are some additional informations, based on @Georg Richter suggestion (see answers).

enter image description here


Solution

  • It looks like PHP on your system is not properly configured, since connection attempt fails due to missing unix socket.

    Check the location of unix_socket, e.g. with command line client:

    MariaDB [(none)]> \s
    --------------
    <snip>
    UNIX socket:            /tmp/mysql.sock
    <snap>
    

    Now make sure that the PHP settings for mysqli have the same settings, e.g. with

    php -i | grep socket
    

    or by checking your php configuration file.