CMS should respect MySQL on custom port number for PDO
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xibo |
Fix Released
|
Low
|
Dan Garner |
Bug Description
Just after installation of Xibo Server when I went to http://
"Database connection problem. SQLSTATE[HY000] [2005] Unknown MySQL server host 'HOST:PORT' (1)"
I am using not standard port for my MySQL database host connection and I have defined that during Xibo Server installation when I was asked for DB host.
I digged down to the code and resolved my issue by correcting PDOConnect class - instead of constructing PDO object using:
self::$conn = new PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname . ';', $dbuser, $dbpass);
I changed it to:
$hoststring = split(":", $dbhost, 2);
self::$conn = new PDO('mysql:host=' . $hoststring[0] . ';port=' . $hoststring[1] . ';dbname=' . $dbname . ';', $dbuser, $dbpass);
Suggestion: in class PDOConnect during creation of PDO object $dbhost shall be checked if there is port included and if so it shall be used in PDO object constructor accordingly to http://
Related branches
- Xibo Maintainters: Pending requested
-
Diff: 166 lines (+30/-25)5 files modifiedserver/config/config.class.php (+6/-4)
server/install.php (+6/-10)
server/lib/app/pdoconnect.class.php (+11/-1)
server/modules/preview/html-preview.js (+1/-0)
server/upgrade.php (+6/-10)
- Xibo Maintainters: Pending requested
-
Diff: 229 lines (+67/-7) (has conflicts)6 files modifieddefault.pot (+8/-0)
server/config/config.class.php (+12/-2)
server/install.php (+12/-0)
server/lib/app/pdoconnect.class.php (+11/-1)
server/modules/preview/html-preview.js (+12/-4)
server/upgrade.php (+12/-0)
Changed in xibo: | |
milestone: | none → 1.6.3 |
status: | New → Confirmed |
Changed in xibo: | |
assignee: | nobody → Dan Garner (dangarner) |
importance: | Undecided → Low |
milestone: | 1.6.3 → 1.6.2 |
status: | Confirmed → Fix Committed |
Changed in xibo: | |
status: | Fix Committed → Fix Released |