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...
I cannot comment so this will be deleted soon unless it is the solution.
Have you tried changing
127.0.0.1
to0.0.0.0
when defining yourmysql
server host?Also, running
sudo systemctl restart
onmysql
andmysqld
could fix things or at least give you some additional info if it fails to restart.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!