6.0.0-git
2021-01-18

[#9738] Fatal error using localhost MySQL with port number
Summary Fatal error using localhost MySQL with port number
Queue Horde Base
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester a.p.meiners (at) planet (dot) nl
Created 2011-03-29 (3583 days ago)
Due
Updated 2011-06-30 (3490 days ago)
Assigned 2011-05-21 (3530 days ago)
Resolved 2011-06-30 (3490 days ago)
Milestone
Patch No

History
2011-06-30 08:52:30 Jan Schneider State ⇒ Resolved
 
2011-06-30 08:52:24 Git Commit Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

[jan] Convert host parameter from "localhost" to "127.0.0.1" in MySQL 
drivers (Request #9738).

  5 files changed, 46 insertions(+), 31 deletions(-)
http://git.horde.org/horde-git/-/commit/05341a899795de7b85ee1ace58ffe4969baa677d
2011-05-21 22:02:30 Chuck Hagenbuch Comment #5
State ⇒ Assigned
Reply to this comment
Sounds okay to me.
2011-05-18 16:23:34 Jan Schneider Comment #4
Version ⇒ Git master
Reply to this comment
I tend to convert "localhost" to "127.0.0.1" automatically, because 
this is probably what most users intended, and the magic behavior of 
MySQL to use sockets if the host is "localhost" already caused many 
WTF moments for administrators.
OTOH many admins and developers might already be aware of this 
behavior and could be using "localhost" intentionally.
Anybody having an opinion on this?
2011-03-29 12:57:52 Jan Schneider Comment #3
Assigned to Jan Schneider
State ⇒ Feedback
Reply to this comment
For now, I've removed the exception.

I tend to convert "localhost" to "127.0.0.1" automatically, because 
this is probably what most users intended, and the magic behavior of 
MySQL to use sockets if the host is "localhost" already caused many 
WTF moments for administrators.
OTOH many admins and developers might already be aware of this 
behavior and could be using "localhost" intentionally.
2011-03-29 12:54:36 Git Commit Comment #2 Reply to this comment
Changes have been made in Git for this ticket:

Don't throw exception when setting port number while using localhost 
in PDO MySQL driver (Bug #9738)

  3 files changed, 3 insertions(+), 5 deletions(-)
http://git.horde.org/horde-git/-/commit/064351164191941ac0fc781b74bd752802448e90
2011-03-29 08:29:56 a (dot) p (dot) meiners (at) planet (dot) nl Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Fatal error using localhost MySQL with port number
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
Reply to this comment
Localhost with portnumber fatal error:
During configuration you can enter 'localhost' as TCP MySQL host. If 
however you do not delete the port number this results in a fatal 
error and Horde4 will not start. If you have deleted the port number, 
saved the config, move to a different tab and change paramaters on 
that tab and again save the config, the default port number is again 
entered in the MySQL host tab and thus again results in a fatal error.

Workaround:
There is a simple workaround which if included in the installation 
documentation can avoid the issue. If instead of 'localhost' you enter 
the IP address 127.0.0.1 as the TCP host, you can leave the port 
number unchanged and all works fine.

Solution:
A more elegant solution would possibly be adding one line of code 
which behind the scenes changes or equates 'localhost' with the IP 
address 127.0.0.1 or simply neglects the port value in case of 
'localhost' or '127.0.0.1' entry.

Saved Queries