Bug 974899 - phpmyadmin can not connect to mysql
Summary: phpmyadmin can not connect to mysql
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Vojtech Vitek
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-17 05:23 UTC by Lei Zhang
Modified: 2015-05-14 23:21 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-24 14:56:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lei Zhang 2013-06-17 05:23:21 UTC
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):
devenv_3368
rhc-1.10.1 build from devenv_3368

How reproducible:
always

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

Actual results:
Error displays when access Connection URL(https://zend5-rayzhang.dev.rhcloud.com/phpmyadmin/) of phpmyadmin-3.4. 

Expected results:
Connection URL(https://zend5-rayzhang.dev.rhcloud.com/phpmyadmin/) of phpmyadmin-3.4 can be accessed. 

Additional info:

Comment 1 Lei Zhang 2013-06-17 05:54:51 UTC
After ssh into the app, mysql can be connected.

Comment 2 Vojtech Vitek 2013-06-18 19:28:05 UTC
I followed the steps to reproduce on curent production:

ZEND
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

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

Comment 3 Vojtech Vitek 2013-06-18 20:25:10 UTC
Reproduced on current DEVENV.

Comment 4 Hiro Asari 2013-06-18 21:17:42 UTC
Verified with the devenv. phpMyAdmin is not picking up the config file. It is then defaulting to connect to 'localhost' via socket.

Comment 5 Vojtech Vitek 2013-06-18 22:05:58 UTC
This bug is v1->v2 regression.

Comment 6 Vojtech Vitek 2013-06-19 00:21:33 UTC
https://github.com/openshift/origin-server/pull/2893

This bug must be fixed in the following exact order:
1. Run phpmyadmin v2->v2 migration
2. Update phpmyadmin cartridge RPM on each node

Comment 7 Vojtech Vitek 2013-06-19 01:12:35 UTC
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
configuration.

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.

Comment 8 Vojtech Vitek 2013-06-19 16:54:21 UTC
Alternative Pull Request without the /sandbox polydir concept:

https://github.com/openshift/origin-server/pull/2899

Comment 9 Vojtech Vitek 2013-06-19 20:50:25 UTC
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.

https://github.com/openshift/origin-server/pull/2906

Comment 10 Vojtech Vitek 2013-06-19 21:33:14 UTC
The same as above but bundle the phpMyAdmin into the cartridge RPM:
https://github.com/openshift/origin-server/pull/2907

Comment 12 Lei Zhang 2013-06-21 02:40:25 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.