[BUG&FIX;] Connect to database using dsn with non-default port - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [BUG&FIX;] Connect to database using dsn with non-default port (/showthread.php?tid=52738) |
[BUG&FIX;] Connect to database using dsn with non-default port - El Forum - 06-24-2012 [eluser]Unknown[/eluser] CI Version: 2.1 My mysql listens on a non-default port for some security reasons. When I tried to connect to my db with DSN, CI just report can't connect. I double checked my DSN and can't find any problem, so I check the code of CI, I found the problem and fixed it. Here is it: When CI parse the dsn, it forgets the port of DSN, so add it. file: {CI base}/system/database/DB.php lines: Code: $params = array( Change to: Code: $params = array( |