Welcome Guest, Not a member yet? Register   Sign In
connect to remote mysql server
#1

[eluser]khyqo[/eluser]
good day everyone.. i hope i am posting my query in the right forum..

i am developing a site and i am coding using my localhost.. but i wanted to use the database from my web server (which have already data) rather than using my localhost mysql.. are there any feature/functionality in CI that i could use? please advice..

thanks in advance..
#2

[eluser]keithics[/eluser]
You can actually work on it directly. for my website. I put something db1.variomedia.de as a host.
It also depends if your mysql server supports remote connection.
#3

[eluser]khyqo[/eluser]
i can allow my ip to access my web server.. but where do i put that? in mysql_driver.php?
#4

[eluser]n0xie[/eluser]
application/config/database.php ?
#5

[eluser]khyqo[/eluser]
this is my database.php

$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "root";
$db['default']['database'] = "database_one";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

$db['alternate']['hostname'] = "localhost";
$db['alternate']['username'] = "root";
$db['alternate']['password'] = "root";
$db['alternate']['database'] = "database_two";
$db['alternate']['dbdriver'] = "mysql";
$db['alternate']['dbprefix'] = "";
$db['alternate']['pconnect'] = TRUE;
$db['alternate']['db_debug'] = TRUE;
$db['alternate']['cache_on'] = FALSE;
$db['alternate']['cachedir'] = "";
$db['alternate']['char_set'] = "utf8";
$db['alternate']['dbcollat'] = "utf8_general_ci";
#6

[eluser]keithics[/eluser]
[quote author="n0xie" date="1291240685"]application/config/database.php ?[/quote]
database config...
:bug:
#7

[eluser]Dennis Rasmussen[/eluser]
I smell fail topic :<
Just edit your database configuration and change the hostname.

Tadaaa......
#8

[eluser]khyqo[/eluser]
thats what i did.. i should have closed this topic yesterday.. how do i close it? Big Grin

anyways, thanks for the response..




Theme © iAndrew 2016 - Forum software by © MyBB