Bug #48117

Mysql Socket connection fails.

Added by Jaro von Flocken about 2 years ago. Updated about 2 years ago.

Status:Resolved Start date:2013-05-12
Priority:Must have Due date:
Assigned To:Philipp Gampe % Done:

100%

Category:Database API Spent time: -
Target version:-
TYPO3 Version:6.1 Is Regression:
PHP Version:5.3 Sprint Focus:
Complexity:easy

Description

A connection via socket fails because the socket part is taken as the port wich ist wrong and results in a connection exception.

From the PHP Dokumentation:
The MySQL server parameter: It can also include a port number. e.g. "hostname:port or a path to a local socket e.g." for the localhost.


Related issues

related to Core - Task #47455: Separate DB TYPO3_CONF_VARS settings host and port Resolved 2013-04-22
related to Core - Bug #49186: Install tool: DB port setting magic Resolved 2013-06-24 2013-06-24

Associated revisions

Revision da7a0de4
Added by Philipp Gampe about 2 years ago

[BUGFIX] Support mysql socket connection

With the switch to mysqli in 6.1, the connection to mysql server via
socket broke.

With mysqli, the definition is now:
  • If hostname is "localhost", a socket is used and the socket file
    can be given optionally if it is different from the default.
  • If hostname is not "localhost" but an IP address, a port can be
    given that may be different from the default mysql 3306.

The patch now reflects this in the database connect step and adds a
parameter for the optional socket location. The patch will be adapted
for 6.1 to include only the additional optional socket parameter.

Resolves: #48117
Related: #49162
Releases: 6.2, 6.1
Change-Id: I968a72dbaf90b3f319c03e697137630534d325c1
Reviewed-on: https://review.typo3.org/20933
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Markus Klein
Tested-by: Markus Klein

Revision 7381ca27
Added by Philipp Gampe about 2 years ago

[BUGFIX] Support mysql socket connection

With the switch to mysqli in 6.1, the connection to mysql server via
socket broke.
With mysqli, the definition is now:
  • If hostname is "localhost", a socket is used and the socket file
    can be given optionally if it is different from the default.
  • If hostname is not "localhost" but an IP address, a port can be
    given that may be different from the default mysql 3306.

This backport just considers the LocalConfiguration.php setting and
does not change anything in the installer.

Resolves: #48117
Releases: 6.2, 6.1
Change-Id: I968a72dbaf90b3f319c03e697137630534d325c1
Reviewed-on: https://review.typo3.org/21973
Reviewed-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

History

#1 Updated by Wouter Wolters about 2 years ago

Hi Jaro,

We do not use MySQL but MySQLi in TYPO3 6.1. So there needs to be a change to support the Socket parameter.
http://nl3.php.net/manual/en/mysqli.real-connect.php

I will contact the person who implemented the new code in this area.

#2 Updated by Jaro von Flocken about 2 years ago

Hi Wouter,

this would be the cleanest way having an option for port number OR socket. Otherwise the solution would be detecting the type of the content behind the ":" char (string or integer).

Does it help providing you with a patch?

cheers,

Jaro

#3 Updated by Philipp Gampe about 2 years ago

  • Status changed from New to Needs Feedback

@Jaro, it would be really cool if you would provide a patch.

We need a new install tool setting and support for this setting in the connect method.

If you want, you can also push this to our review server:
http://wiki.typo3.org/Contribution_Walkthrough_Tutorials

#4 Updated by Alexander Opitz about 2 years ago

Does #47455 "Separate DB TYPO3_CONF_VARS settings host and port" helps? (This doesn't have a install option yet).

#5 Updated by Philipp Gampe about 2 years ago

  • Status changed from Needs Feedback to Accepted
  • Complexity set to easy

@Alexander, no as the PHP API is not different ... we need a specific Install Tool setting for socket and we need to use this in bootstrap and DatabaseConnection.

#6 Updated by Philipp Gampe about 2 years ago

  • Assigned To set to Philipp Gampe
  • % Done changed from 0 to 20

#7 Updated by Gerrit Code Review about 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#8 Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#9 Updated by Gerrit Code Review about 2 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#10 Updated by Gerrit Code Review about 2 years ago

Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#11 Updated by Gerrit Code Review about 2 years ago

Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#12 Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#13 Updated by Gerrit Code Review about 2 years ago

Patch set 7 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20933

#14 Updated by Gerrit Code Review about 2 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21973

#15 Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/21973

#16 Updated by Philipp Gampe about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 20 to 100

Also available in: Atom PDF