0

I am using CodeIgniter and I am trying to access a database that is placed remotely on another server. I can access that server remotely but I can't connect via my MySQL Connection settings. Here are my MySQL settings:

$db['default']['hostname'] = 'myhostname';

$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'MyDb';
$db['default']['dbdriver'] = 'mysqli';
$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['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

I am not sure where I am making a mistake so if someone can point out the mistake it will be really helpful.

3
  • apparently there is something wrong on server side, check your access log or try log in there manually first Commented Aug 16, 2012 at 8:58
  • how do you access server? have you tried connecting to mysql without using CI? do you have a cpanel on remote server? Commented Aug 18, 2012 at 23:03
  • What error do you get? Commented Oct 2, 2013 at 17:14

1 Answer 1

1

First, check username and password for mysql (obviously username cannot be root and password cannot be blank for security reasons) and for hostname, you might have to supply IP address of your server where mysql is hosted. Rest configurations appear to be fine. You can ask for these information from your hosting company.

Sign up to request clarification or add additional context in comments.

1 Comment

on local envoirment password can be blank

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.