Score:0

Unable to connect to server following phpMyAdmin upgrade from 5.1 to 5.2

cn flag

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 127.0.0.1 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
/etc/phpMyAdmin/config.inc.php
/etc/phpMyAdmin/config.inc.php.rpmnew
/etc/phpMyAdmin/config.inc.php.rpmsave

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!


EDIT

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

Score:0
cn flag

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!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.