I have done my website normally in localhost with wamp, and it came the moment to upload it inline.
I've used Cakephp 2, with the security component that block all the website. So I have to login me, before to go directly in the application. I've uploaded my data base into phpmyadmin on my web server (OVH - Perso offer, so no ssh available). I've configured the database.php file with my database informations. It is well those one, I'm sure, because it's the same like my main website (because this application is into a folder at the root of my site itself developed with Cakephp).
At a glance, when I try to access to my site, I've this error message, and I don't know why .. :
Missing Database Connection
Error: A Database connection using "Mysql" was missing or unable to connect.
The database server returned this error: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' (2)
Notice: If you want to customize this error message, create app/View/Errors/missing_connection.ctp
Stack Trace
CORE/Cake/Model/Datasource/DboSource.php line 260 → Mysql->connect()
CORE/Cake/Model/ConnectionManager.php line 105 → DboSource->__construct(array)
CORE/Cake/Model/Model.php line 3482 → ConnectionManager::getDataSource(string)
CORE/Cake/Model/Model.php line 1128 → Model->setDataSource(string)
CORE/Cake/Model/Model.php line 3504 → Model->setSource(string)
CORE/Cake/Model/Model.php line 1357 → Model->getDataSource()
CORE/Cake/View/Helper/FormHelper.php line 215 → Model->schema()
CORE/Cake/View/Helper/FormHelper.php line 468 → FormHelper->_introspectModel(string, string)
APP/View/Layouts/login.ctp line 30 → FormHelper->create(string)
CORE/Cake/View/View.php line 948 → include(string)
CORE/Cake/View/View.php line 910 → View->_evaluate(string, array)
CORE/Cake/View/View.php line 542 → View->_render(string)
CORE/Cake/View/View.php line 479 → View->renderLayout(string, string)
CORE/Cake/Controller/Controller.php line 954 → View->render(null, null)
CORE/Cake/Routing/Dispatcher.php line 198 → Controller->render()
CORE/Cake/Routing/Dispatcher.php line 165 → Dispatcher->_invoke(UsersController, CakeRequest)
APP/webroot/index.php line 108 → Dispatcher->dispatch(CakeRequest, CakeResponse)
My database.php file :
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'root',
'password' => '',
'database' => 'prolity',
'prefix' => '',
//'encoding' => 'utf8',
);
public $ovh = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => '***',
'login' => '***',
'password' => '***',
'database' => '***',
'prefix' => '',
'encoding' => 'utf8',
);
}
I use just $ovh, and it's well selected in bootstrap.php. I even tried to put
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
But it's the same thing.
I have all audited, and all seems correct. Google didn't help me really well, and I'm turning to you because I don't have any other ideas.
I can give you the link inline, but I think it's not really necessary.
Thanks for you're help,
Etix.