2

The settings in \config\database.php for remote database connectivity are the following:

// Remote Server settings
$db['default']['hostname'] = 'abc.com';
$db['default']['username'] = 'admin';
$db['default']['password'] = 'password';
$db['default']['database'] = 'mydatabase';

But accessing the webpage via browser it gives the following error.

A Database Error Occurred

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

Is there any issue with hostname? Other credentials are correct but I am not sure about hostname! I provided the IP address of my website also but both give the same error. The hostname of mysql database will be different than the website? although I hosted the database on the same server using CPANEL.

3
  • In my experience, when I have had this problem it's a firewall issue on the remote machine. Commented Feb 4, 2015 at 15:40
  • If the database is hosted on the same server as the website, then you can just use "localhost" Commented Feb 4, 2015 at 15:41
  • Really thankful for your solution of "localhost". Thanks :) Commented Feb 4, 2015 at 16:10

1 Answer 1

0

If the database is on the same server, use localhost for the hostname.

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

Comments

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.