Question:
Joomla is unable to connect with mysql database hosted in another server?
anonymous
2011-01-06 02:13:06 UTC
We have deployed the Joomla CMS in yahoo server. Required database settings done in "configuration.php" file.But it is not connected to the mysql database and shows "Database Error: Unable to connect to the database:Could not connect to MySQL".

Please note that our database is deployed in another server('http://www.example.com/subdomain'). We have mentioned this as our $hostname in configuration file. But it is not connecting.
Three answers:
just "JR"
2011-01-06 02:25:23 UTC
Using "www.example..." instead of "localhost" will NOT work!

Your connection is, normally, "localhost, username, password"... and will alway have to be "localhost".

You will need to use cURL() function in Php to access the "other" server. Once there, you can use the normal (localhost) call to connect to the db.

Do not forget: "localhost" is linked to a unique "domain"... that is not yours.
anonymous
2016-11-08 09:16:21 UTC
If it have been a username / password challenge the blunders could point out so. the blunders you're receiving regularly occurs once you have the host get right of entry to incorrect. Many internet internet hosting businesses configure their MySQL databases so which you will get right of entry to as "localhost". although, some, like Godaddy, rather have their MySQL databases on a differerent server so which you're able to desire to be sure including your internet hosting provider as to what host you need to use to get right of entry to the database. additionally, only double examine to be certain which you do are using prefix_username and prefix_database
JustMe
2011-01-06 14:20:57 UTC
Your MySQL doesn't have to be on the localhost. It could be remote if your server allows remote connections. 99% of the time it's not allowed and for a good reason - security.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...