0

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:

  • Import MariaDB repository key:

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

  • Add MariaDB specific repository for 10.6 version:

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

  • Install MariaDB 10.6:

sudo zypper install MariaDB-server MariaDB-client

  • Choose solution 1 being uninstalling 10.5 packages (when prompted)

  • Start mariadb service using systemctl start mariadb.

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:

  • I'm not able to connect to phpMyAdmin. Connection page is loading properly but I get the following error message:

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

  • My applications are not working. It seems there is a problem for connecting to MariaDB service. Example for GLPI:

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

wiltomap
  • 3,933
  • 8
  • 37
  • 54

1 Answers1

1

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.

Georg Richter
  • 5,970
  • 2
  • 9
  • 15
  • Thanks for help! I updated initial post with a screenshot of the commands I passed. The Unix socket was not the same in MariaDB and in PHP configuration file. Strangely, `php -i | grep socket` returns a value for `mysqli.default_socket` whereas php.ini file contains no value for this parameter. Could you have a look at the post update? – wiltomap May 24 '22 at 13:01
  • I eventually had to modify the `mysqli.default_socket` parameter in `/etc/php7/apache2/php.ini`. This corrected the problem. – wiltomap May 25 '22 at 06:50