cakephp 3.0 - SQLSTATE HY000 2002 while running bake command -


i have problem running bake commands. think related mysql didn't find solution error on stackoverflow. app.php:

'datasources' => [         'default' => [             'classname' => 'cake\database\connection',             'driver' => 'cake\database\driver\mysql',             'persistent' => false,             'host' => 'localhost',              //'port' => 'nonstandard_port_number',             'username' => 'root',             'password' => 'root',             'database' => 'laboiterose',             'encoding' => 'utf8',             'timezone' => 'utc',             'cachemetadata' => true, 

please help, error get, is:

exception: sqlstate[hy000] [2002] no such file or directory in [/applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/driver/pdodrivertrait.php, line 48] 2015-06-19 14:35:48 error: [pdoexception] sqlstate[hy000] [2002] no such file or directory stack trace: 0 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/driver/pdodrivertrait.php(48): pdo->__construct('mysql:host=loca...', 'root', 'root', array) 1 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/driver/mysql.php(89): cake\database\driver\mysql->_connect('mysql:host=loca...', array) 2 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/schema/baseschema.php(46): cake\database\driver\mysql->connect() 3 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/dialect/mysqldialecttrait.php(62): cake\database\schema\baseschema->__construct(object(cake\database\driver\mysql)) 4 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/schema/collection.php(52): cake\database\driver\mysql->schemadialect() 5 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/schema/cachedcollection.php(44): cake\database\schema\collection->__construct(object(cake\database\connection)) 6 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/database/connection.php(319): cake\database\schema\cachedcollection->__construct(object(cake\database\connection), true) 7 /applications/mamp/htdocs/my_db/vendor/cakephp/bake/src/shell/task/modeltask.php(806): cake\database\connection->schemacollection() 8 /applications/mamp/htdocs/my_db/vendor/cakephp/bake/src/shell/task/modeltask.php(782): bake\shell\task\modeltask->_getalltables() 9 /applications/mamp/htdocs/my_db/vendor/cakephp/bake/src/shell/task/modeltask.php(186): bake\shell\task\modeltask->listall() 10 /applications/mamp/htdocs/my_db/vendor/cakephp/bake/src/shell/task/modeltask.php(109): bake\shell\task\modeltask->getassociations(object(cake\orm\table)) 11 /applications/mamp/htdocs/my_db/vendor/cakephp/bake/src/shell/task/modeltask.php(95): bake\shell\task\modeltask->bake('users') 12 /applications/mamp/htdocs/my_db/vendor/cakephp/bake/src/shell/bakeshell.php(241): bake\shell\task\modeltask->main('users') 13 [internal function]: bake\shell\bakeshell->all('users') 14 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/console/shell.php(380): call_user_func_array(array, array) 15 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/console/shelldispatcher.php(204): cake\console\shell->runcommand(array, true) 16 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/console/shelldispatcher.php(175): cake\console\shelldispatcher->_dispatch() 17 /applications/mamp/htdocs/my_db/vendor/cakephp/cakephp/src/console/shelldispatcher.php(126): cake\console\shelldispatcher->dispatch() 18 /applications/mamp/htdocs/my_db/bin/cake.php(33): cake\console\shelldispatcher::run(array) 19 {main} 

problem solved!! thing should add line in .bash_profile make work:

export path=/applications/mamp/bin/php/php5.6.10/bin:$path 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -