Welcome Guest, Not a member yet? Register   Sign In
External DB?
#1

[eluser]spaceflunk[/eluser]
Hello
Isnt it possible to connect to an external DB using codeignitor?


Thanks!
#2

[eluser]danmontgomery[/eluser]
Yes...

Code:
$db['default']['hostname'] = "[address to database server]";
#3

[eluser]spaceflunk[/eluser]
When i do this i get this error:


-----------------------------------------------------------------------
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /share/HDA_DATA/Qweb/system/application/controllers/pos.php:3)

Filename: codeigniter/Common.php

Line Number: 360
A Database Error Occurred

Unable to connect to your database server using the provided settings.


-----------------------------------------------------------------------

But the server isnt on a standard port, but port 3306.

$db['default']['hostname'] = "[adress]:3306";

Isnt this correct?
#4

[eluser]danmontgomery[/eluser]
It is... 3306 is the default port for MySQL, what DB are you using?

I would check settings on the DB server.
#5

[eluser]spaceflunk[/eluser]
It is just regular mysql on a hosted server. Dont know if there is a setting allowing external connections, do you know that?
#6

[eluser]danmontgomery[/eluser]
There's not. But you don't need to add :3306 for mysql, as it's the default port (although doing so makes no difference).

Again, I would check settings on the DB server. The server may be rejecting all external connections to that port, or you may just need to add permissions for the user. Your host would be able to tell you things like this.




Theme © iAndrew 2016 - Forum software by © MyBB