Take the 2-minute tour ×
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 damiracle.net (as I am not authorized to give more than one hyperlink I have to write like this way) and damiracle.biz.

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

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

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

define('DB_NAME', 'the_db_name_of_the DB_inside_damiracle.net');

define('DB_USER', 'the_db_user_name_of_the DB_inside_damiracle.net');

define('DB_PASSWORD', 'the_password_of_the DB_inside_damiracle.net');

define('DB_HOST', 'ip_address_of_damiracle.net');

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

I had also tried setting the DB_HOST by writing damiracle.net:port 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 at 13:22
    
You also need to allow remote mysql connections in cpanel with hostgator. –  Andrew Bartel Apr 25 at 15:07
    
Thanks everyone for helping me. My problem is solved. It was my host server issue. Thanks again. –  amitabhaghosh197 Apr 28 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.

Read http://support.hostgator.com/articles/cpanel/how-to-connect-to-the-mysql-database-remotely

share|improve this answer

Your Answer

 
discard

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.