Red Hat Bugzilla – Bug 974899
phpmyadmin can not connect to mysql
Last modified: 2015-05-14 19:21:50 EDT
Description of problem:
When access Connection URL of phpmyadmin, "phpMyAdmin - Error" displays. Error detail info: "#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
The server is not responding (or the local server's socket is not correctly configured)."
Version-Release number of selected component (if applicable):
rhc-1.10.1 build from devenv_3368
Steps to Reproduce:
1. rhc app create -a zend5 -t zend-5.6
2. rhc cartridge add -a zend5 -c mysql-5.1 and rhc cartridge add -a zend5 -c phpmyadmin-3.4
Error displays when access Connection URL(https://zend5-rayzhang.dev.rhcloud.com/phpmyadmin/) of phpmyadmin-3.4.
Connection URL(https://zend5-rayzhang.dev.rhcloud.com/phpmyadmin/) of phpmyadmin-3.4 can be accessed.
After ssh into the app, mysql can be connected.
I followed the steps to reproduce on curent production:
rhc app create -a zend5 -t zend-5.6
rhc cartridge add -a zend5 -c mysql-5.1
rhc cartridge add -a zend5 -c phpmyadmin-3.4
rhc app create -a php5 -t php-5.3
rhc cartridge add -a php5 -c mysql-5.1
rhc cartridge add -a php5 -c phpmyadmin-3.4
..and in both cases the PHPMyAdmin is working correctly.
Reproduced on current DEVENV.
Verified with the devenv. phpMyAdmin is not picking up the config file. It is then defaulting to connect to 'localhost' via socket.
This bug is v1->v2 regression.
This bug must be fixed in the following exact order:
1. Run phpmyadmin v2->v2 migration
2. Update phpmyadmin cartridge RPM on each node
Explanation of the above:
All nodes where phpmyadmin v1 cartridge was ever installed have the
/etc/phpMyAdmin/config.inc.php file changed to the OpenShift-specific
All "pure" v2 nodes doesn't have that OpenShift configuration but the
RHEL's default one instead. This is the cause of bug 974899.
We need to make sure that we're going to provide the user-space symlinks
in all the gears (/sandbox/phpMyAdmin/config.inc.php) prior to fixing
the /etc/phpMyAdmin/config.inc.php file by replacing it with a symlink
to sandbox, as we can't let it point to yet nonexistent gear paths.
Alternative Pull Request without the /sandbox polydir concept:
Another Pull Request - the cartridge RPM makes local copy of phpMyAdmin to the cartridge /usr directory. And the RPM is not changing any file owned by root, finally.
The same as above but bundle the phpMyAdmin into the cartridge RPM:
Commit pushed to master at https://github.com/openshift/origin-server
fix phpMyAdmin config file
Fixes bug 974899
Test on INT(devenv_3395), Connection URL of phpmyadmin can be accessed successfully and check the related file in devev instance,cartridges/openshift-origin-cartridge-phpmyadmin/openshift-origin-cartridge-phpmyadmin.spec and cartridges/openshift-origin-cartridge-phpmyadmin/versions/shared/phpMyAdmin/config.inc.php also were changed. so verified it.