Today I have got a new project that is in Joomla.
I have website code downloaded on my computer.
Website administration panel is cpanel.
I have never done anything with Joomla site before.
When I open website on my local machine (http://localhost/ppp/public_html/index.php) it says Database connection error (2): Could not connect to MySQL.
However, I have changed configuration.php file (it was my guess that I need to change it):
//Before my changes it was the following:
public $host = 'localhost';
public $user = 'reiuser_reiuser';
public $password = 'password';
public $db = 'reiuser_reiuser';
//After my changes:
public $host = '174.121.134.94'; //IP was displayed in cpanel
public $user = 'reiuser_reiuser';
public $password = 'password';
public $db = 'reiuser_reiuser';
I have read info about this error and most says to check connection data.
However, I can successfully connect with HeidiSql using those connection data (user/password/db were changed).
Maybe here is not enough information, but maybe Joomla developers can suggest what to do?
Which Joomla file is dooing connection? Maybe I can do some echos to understand the cause of error?
Website is using CPanel.
Thank you.
When I tried to use mysql_connect directly, I got something like
mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol…
The link for a sollution I have found here.
“The above problem occures because of version in-compatibility between PHP and MySql. Mostly it may occurs during remote access of db.”
I downgraded my php and apache (I am using wamp) and now connection is ok.