Not sure to post on the right StackExchange forum. If not, let me know!

Working environment:

  • OpenSUSE Leap 15.4
  • MariaDB : mariadb Ver 15.1 Distrib 10.7.7-MariaDB
  • PHP 8.0.25 (cli) (built: Oct 31 2022 12:00:00) ( NTS )

Based on phpinfo(), PHP ini file is: /etc/php8/cli/php.ini.

phpMyAdmin 5.1 is working well. Installation directory is: /usr/share/phpMyAdmin (default directory created when installing via zypper install phpMyAdmin command). The "famous" option $cfg['Servers'][$i]['host'] from /etc/phpMyAdmin/config.inc.php file is set to localhost (and it does work!).

I have then upgraded phpMyAdmin version this way:

srv-bla:~ # mv /usr/share/phpMyAdmin /usr/share/phpMyAdmin.old
srv-bla:~ # mkdir /usr/share/phpMyAdmin
srv-bla:~ # wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.tar.gz
srv-bla:~ # tar -xzf phpMyAdmin-5.2.0-all-languages.tar.gz
srv-bla:~ # mv phpMyAdmin-5.2.0-all-languages/* /usr/share/phpMyAdmin/

I then restart daemons and test the connection: srv-bla:~ # systemctl restart mysqld mariadb apache2

The connection page is showing right. I then enter my credentials and I get stuck with this bloody message:

Impossible to connect to server. mysqli::real_connect(): (HY000/2002): No such file or directory

I have wandered for a while on numerous webpages. Many of them suggest to modify the config.inc.php file and to set $cfg['Servers'][$i]['host'] option to instead of localhost. Unfortunately, this does not fix the problem for me...

Am I editing the right config.inc.php file? Actually, I can find only one on the server:

srv-bla:~ # updatedb
srv-bla:~ # locate config.inc.php

Apache logs are not friendly either. Access logs returns 200 codes only, which seems normal to me (the phpMyAdmin webpage is served properly). Error logs are empty... Mysql logs are empty also (/var/log/mysql/mysqld.log).

Or course, I have check that mysqld service (same as mariadb service) is running.

Any help or ideas would be much appreciated!


The socket file from MariaDB point of view is:

srv-bla:~ # mariadb -u root -p
Enter password:
MariaDB [(none)]> \s
UNIX socket: /var/lib/mysql/mysql.sock

The php.ini file is configured the same way:

srv-bla:~ # cat /etc/php8/cli/php.ini | grep mysqli.default_socket
mysqli.default_socket = /var/lib/mysql/mysql.sock

To me, there is no socket issue...

  • The socket which phpmyadmin is trying to connect is different from where MariaDB is placing the socket.
    – danblack
    Dec 7, 2022 at 3:38
  • Thanks @danblack. I have edited my post to tell more about this socket issue, which is not the problem to me. Unless I've missed something.
    – wiltomap
    Dec 7, 2022 at 8:48
  • Your php isn't running as root. So maybe the /var/lib/mysql isn't allowing the connection, or a selinux boolean (though I'd expect that to be an EPERM rather than not found). Try using the pma setting for socket.
    – danblack
    Dec 7, 2022 at 21:59
  • The link you suggest did not help me, unfortunately... I don't know what is config-db.php file.
    – wiltomap
    Dec 8, 2022 at 10:40
  • In addition, PHP is running as root as the php -r "echo exec('whoami');" command returns.
    – wiltomap
    Dec 8, 2022 at 10:45

1 Answer 1


Solution for me:

The PHP configuration file returned by php -r 'phpinfo();' command in a terminal is /etc/php8/cli/php.ini.

The PHP configuration file returned by the phpinfo() function called with a URL such as http://myserver.fr/phpinfo.php is /etc/php8/apache2/php.ini.

I modified the line mysqli.default_socket = /var/lib/mysql/mysql.sock in this other configuration file and could call again phpMyAdmin with success. Note that emtying the browser cache was necessary!

Thanks for help, and hope this will help others!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.