Hellow friends! I need some help, please.
I’m having troubles to execute this command bin/cake bake migration_snapshot Initial. It returns the following message.
Welcome to CakePHP v3.3.9 Console
App : src Path: /opt/lampp/htdocs/estoque/src/
PHP : 7.0.8-0ubuntu0.16.04.3
Exception: SQLSTATE[HY000] [2002] No such file or directory in [/opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php, line 47] 2016-12-06 16:42:37 Error: [PDOException] SQLSTATE[HY000] [2002] No such file or directory Stack Trace:
0 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Driver/PDODriverTrait.php(47): PDO->__construct(‘mysql:host=loca…’, ‘root’, ‘password’, Array)
1 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Driver/Mysql.php(104): Cake\Database\Driver\Mysql->_connect(‘mysql:host=loca…’, Array)
2 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Schema/BaseSchema.php(45): Cake\Database\Driver\Mysql->connect()
3 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Dialect/MysqlDialectTrait.php(63): Cake\Database\Schema\BaseSchema->__construct(Object(Cake\Database\Driver\Mysql))
4 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Schema/Collection.php(52): Cake\Database\Driver\Mysql->schemaDialect()
5 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Schema/CachedCollection.php(42): Cake\Database\Schema\Collection->__construct(Object(Cake\Database\Connection))
6 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Database/Connection.php(322): Cake\Database\Schema\CachedCollection->__construct(Object(Cake\Database\Connection), true)
7 /opt/lampp/htdocs/estoque/vendor/cakephp/migrations/src/Shell/Task/MigrationSnapshotTask.php(102): Cake\Database\Connection->schemaCollection()
8 /opt/lampp/htdocs/estoque/vendor/cakephp/migrations/src/Shell/Task/MigrationSnapshotTask.php(35): Migrations\Shell\Task\MigrationSnapshotTask->getCollection(Object(Cake\Database\Connection))
9 /opt/lampp/htdocs/estoque/vendor/cakephp/bake/src/Shell/Task/SimpleBakeTask.php(86): Migrations\Shell\Task\MigrationSnapshotTask->bake(‘Initial’)
10 [internal function]: Bake\Shell\Task\SimpleBakeTask->main(‘Initial’)
11 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Console/Shell.php(466): call_user_func_array(Array, Array)
12 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Console/Shell.php(459): Cake\Console\Shell->runCommand(Array, false, Array)
13 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(227): Cake\Console\Shell->runCommand(Array, true, Array)
14 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(182): Cake\Console\ShellDispatcher->_dispatch(Array)
15 /opt/lampp/htdocs/estoque/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php(128): Cake\Console\ShellDispatcher->dispatch(Array)
16 /opt/lampp/htdocs/estoque/bin/cake.php(34): Cake\Console\ShellDispatcher::run(Array)
17 {main}
Obs.: I’m using Ubuntu 16.04 and Xampp.