Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Yesterday I had asked this question but it was down voted due to the rules of this forum. Anyway, this is my learning and I really thank to the moderators who down voted this as they helped me to gain the tips.

My problem is that, I have two domains in my host server Hostgator in the name of (as I am not authorized to give more than one hyperlink I have to write like this way) and

The databases of are frequently accessible to my employees. I have to host a wordpress website in one of my directories in (since there are no possibilities to host that particular website in But I need to secure the database of that particular website in one of the directories in

In that case what I thought is that, I would host the database in and all the wordpress files in the so that my database remains secured from my employees access.

In the wp-config file of the wordpress website in I have mentioned in the following way:

define('DB_NAME', 'the_db_name_of_the');

define('DB_USER', 'the_db_user_name_of_the');

define('DB_PASSWORD', 'the_password_of_the');

define('DB_HOST', '');

Since I have to set the Remote MySQL so I had set the ip-address of

I had also tried setting the DB_HOST by writing No. instead of IP address

But still I face the Database connection error.

Can anyone please help?

Thanks in advance.

share|improve this question
Try using the domain name rather than the IP address. – TheDeadMedic Apr 25 '14 at 13:22
You also need to allow remote mysql connections in cpanel with hostgator. – Andrew Bartel Apr 25 '14 at 15:07
Thanks everyone for helping me. My problem is solved. It was my host server issue. Thanks again. – amitabhaghosh197 Apr 28 '14 at 7:24

1 Answer 1

For security issues, Hostgator requires more parameters - like port, etc. - in wp-config.php to connect to a remote - non-localhost - mysql server.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.