Bug #49186

Install tool: DB port setting magic

Added by Christian Kuhn about 2 years ago. Updated almost 2 years ago.

Status:Resolved Start date:2013-06-24
Priority:Should have Due date:2013-06-24
Assigned To:- % Done:

100%

Category:Install Tool Spent time: -
Target version:6.2.0
TYPO3 Version:6.2 Is Regression:
PHP Version:5.4 Sprint Focus:
Complexity:medium

Description

Currently, the "DatabaseConnect" step is executed, if a "port" setting is missing in typo3_conf_vars db. This is technically ok, since after switch to mysqli in 6.1, the connect methods needs a port setting.

Currently, the bootstrap db connect method tries a split of the former host setting into host and port and then sets the port silently. This is a bit ugly, since this is performed on each and every request. Furthermore, the split can fail, if a ipv6 address is given with a port (eg. [:::1]:3306)

Thus, I suggest to let the bootstrap just redirect to install tool if port is missing, and then implement a solid "silent upgrade" within the database connect class of the step installer before "needsExecuction" is done. This way, if the silent upgrade is ok, the step won't come up. Furthermore, the bootstrap code can be cleaned up from this implicit upgrade.

There is another ticket in this area, regarding 'socket' connection to db. This could also be implemented in the DatabaseConnect then, maybe with a checkbox if host is localhost, no port is needed then.

Furthermore, it is important to note that the mysqli connect method ignores the port setting, if host is set to 'localhost' and not '127.0.0.1', so another "silent upgrade" could switch from string 'localhost' to '127.0.0.1' if the port setting is not the default mysql port 3306.


Related issues

related to Core - Bug #48117: Mysql Socket connection fails. Resolved 2013-05-12
follows Core - Task #49162: Rewrite install tool Resolved 2011-10-30

Associated revisions

Revision 45cbe771
Added by Michiel Roos almost 2 years ago

[FEATURE] Install tool database port detection

The patch adds better auto detection of port settings to
install tool step action "database connect". If everything
works out, the database connect step is not rendered anymore
during upgrading which is the case without the patch.

- Split port off from IP only if IPv4 is used
- Get default or configured port for connection test
- Store port, host and socket on success and redirect to self

Change-Id: Ia5b53fc7eff60c5b2613ecee35cd5ee699e141ca
Resolves: #49186
Releases: 6.2
Reviewed-on: https://review.typo3.org/23332
Reviewed-by: Kai Ole Hartwig
Tested-by: Kai Ole Hartwig
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn

History

#1 Updated by Ernesto Baschny about 2 years ago

Do not change "localhost" with "127.0.0.1", as the first one connects through a SOCKET and the second one through TCP/IP. It requires different authentication to MySQL and potentially MySQL is not even listening on 127.0.0.1 (just a socket).

#2 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

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

#3 Updated by Gerrit Code Review almost 2 years ago

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

#4 Updated by Michiel Roos almost 2 years ago

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

Also available in: Atom PDF