phpMyAdmin and Error 2002

Hi all, I have a problem with my LAMP server. I can’t seem to access mySQL from within a browser. It works fine from a terminal, but from a browser, nothing. This is a fresh install of OpenSUSE 11.0, and I don’t think I’ve done anything wrong. if I did, I would just reinstall again. Anyhow, when I try to run phpMyadmin, I get this…

Error
#2002 - The server is not responding (or the local MySQL server’s socket is not correctly configured)

Could somebody please help me sort this out? I’ve already looked through a tonne of forum posts, and have found nothing useful, other than confirmation that I am not the only one having this problem. Please and thank you.

Where did you get phpMyAdmin from? Did you remember to configure it?

I’m having the exact same problem on Suse 11.1 x86_64

It’s almost certainly something to do with the socket:

ps xa | grep mysqld
 5829 ?        S      0:00 /bin/sh /usr/bin/mysqld_safe --mysqld=mysqld --user=mysql --pid-file=/var/run/mysql/mysqld.pid --socket=/var/run/mysql/mysql.sock --datadir=/var/lib/mysql
 5938 ?        Sl     0:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/mysqld.log --pid-file=/var/run/mysql/mysqld.pid --socket=/var/run/mysql/mysql.sock --port=3306

I can also log in fine with the command-line client, also installed MySql Administrator via Yast and that connects just fine too

I’ve tried adding this line to config.inc.php but it’s made no difference:

$cfg’Servers’]$i]‘socket’] = ‘/var/run/mysql/mysql.sock’;

I’ve tried an rpm from the Suse repos as well as a tarball from phpmyadmin.net

I even tried copying my.cnf and config.inc.php from another machine that has a working mysql/phpmyadmin combo on Suse 11.0 x86_64

Don’t know what else I can try to resolve it

Make sure you have php5-dbase and php5-mysql installed.

What version is your mysql?

rpm -q mysql

It seems some people have been picking up 5.1 from the bleeding edge repos without realising it, where the socket file was moved to /var/run/mysql, when it used to be in /var/lib/mysql in the 5.0 mysql package from the official repo, which works out of the box with phpMyAdmin from the PHP applications repo.

Spot on Ken

That’s what I had done, but I thought editing the socket paths in the confs would solve it … I was wrong

Downgraded to mysql 5 and it’s sorted

Apparently it’s not sufficient to just change the paths. On a RHEL system, upgrading to 5.1 requires a new libmysqlclient.so.16 also. The same might also be true on openSUSE. So to avoid hassles, stick to 5.0 unless you badly need 5.1.

Got the same issue on factory (11.2) x86-64.

Any idea, tip ?

I can login with $ mysql -u root -p -h localhost

But can’t use any php web app.

Got the php-mysql from repository. Got myadmin from phpMyAdmin

When try to login got #2002.