Last modified: 2014-09-14 11:24:59 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67998, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65998 - mysqli: No way to specify the socket location
mysqli: No way to specify the socket location
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.23rc
All All
: Normal normal (vote)
: 1.23.x release
Assigned To: Jesús Martínez Novo (Ciencia Al Poder)
:
Depends on: 45288
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-01 13:29 UTC by Jesús Martínez Novo (Ciencia Al Poder)
Modified: 2014-09-14 11:24 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---
legoktm.wikipedia: Backport_to_Stable+


Attachments

Description Jesús Martínez Novo (Ciencia Al Poder) 2014-06-01 13:29:45 UTC
PHP mysql functions allow to specify the port number or socket location inside the hostname[1]. PHP mysqli functions don't, as they need to go in their own parameters[2]. This was fixed for the port number on bug 58153, but still there's no way to specify the socket location

----

[1] http://php.net/mysql_connect
[2] http://php.net/mysqli_real_connect
Comment 1 Gerrit Notification Bot 2014-06-01 14:04:39 UTC
Change 136638 had a related patch set uploaded by Martineznovo:
Make MySQLi work with non-standard socket

https://gerrit.wikimedia.org/r/136638
Comment 2 Alastair Sherringham 2014-06-02 11:09:38 UTC
I have had a similar issue. On a managed server trying to indtall MW 1.22.7, I cannot connect to the DB.

On the command line, I have to use format :

mysql -u user -S /tmp/mysql5.sock -p database

But I cannot seem to use a "socket" format for the database name in setup e.g.

localhost:/tmp/mysql5.sock

Hopefully, this patch helps (I will see if I can try it).

Thanks Jesús Martínez Novo!
Comment 3 Alastair Sherringham 2014-06-02 14:02:53 UTC
I tested the patched file DatabaseMysqli.php by overwriting the version in 1.22.7 (perhaps not ideal I know). File downloaded as :

https://git.wikimedia.org/raw/mediawiki%2Fcore/5ae151ff168a4596a235db766274df72f151e92f/includes%2Fdb%2FDatabaseMysqli.php

I am glad to say that I could install MW 1.22.7 by using the database name :

localhost:/tmp/mysql5.sock

So this patch fixed my immediate problem. Not sure on any side-effects it might have of course and I do not want to run this in production. So I will wait for release 1.23 and hope this makes it in.

Thanks again.
Comment 4 Gerrit Notification Bot 2014-09-13 05:26:25 UTC
Change 136638 merged by jenkins-bot:
Make MySQLi work with non-standard socket

https://gerrit.wikimedia.org/r/136638
Comment 5 Jesús Martínez Novo (Ciencia Al Poder) 2014-09-13 12:37:47 UTC
Merged for current master (1.24), I'll try to backport to 1.23
Comment 6 Gerrit Notification Bot 2014-09-13 13:29:32 UTC
Change 160212 had a related patch set uploaded by Martineznovo:
Make MySQLi work with non-standard socket

https://gerrit.wikimedia.org/r/160212
Comment 7 Jesús Martínez Novo (Ciencia Al Poder) 2014-09-13 13:40:47 UTC
^ this was the backport, but this is now fixed
Comment 8 Gerrit Notification Bot 2014-09-14 11:24:59 UTC
Change 160212 merged by jenkins-bot:
Make MySQLi work with non-standard socket

https://gerrit.wikimedia.org/r/160212

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


Navigation
Links