i have a website with Joomla 2.5.4, in the configuration file the DB host is coded as localhost. i know the DB name, username, password to access. But not the URL to access the Host. is that Possible to get the information without logging in to C PANEL etc..
in some situations my client fails to give me the url to access DB, if iopen the configuration file, there it says LOCALHOST.
Is there any other way to find out?
If the
configuration.phphaslocalhostthen it should be the same as the website/the ip address of the website. Remember ‘localhost’ is just a synonym for the current computer.I’m not sure why you would want the URL though.
If you’re writing a software extension for Joomla! you don’t need the database details you can just get the database object from the framework, eg.
$db = JFactory::getDBO();If you writing a PHP script external to Joomla! you can just use
localhostin your connection code e.g..To check for errors in the connection you would the check the value in
$mysqli_connection->[connect_error][2]If you want to do a remote connection then the websites address will generally do if the configuration states localhost (obviously if it doesn’t have local host or an equivalent then the value will be the database servers address), but you will also need to setup the remote access through cPanel.