Solucionado (ver solução)
Solucionado
(ver solução)
4
respostas

Erro no dump.sql

Ao usar terminal temos o erro:

MacBook-Pro-de-Silvanio:~ silvanioduartedacruz$ mysql -u root < dump.sql ERROR 1046 (3D000) at line 22: No database selected

Ao usar o Workbench temos o erro:

```11:02:54 Restoring estoque_laravel (back_produtos) Running: /Applications/MySQLWorkbench.app/Contents/MacOS/mysql --defaults-file="/var/folders/1b/pv4yyl0575j2sntfg045h43r0000gn/T/tmprw6hxc/extraparams.cnf" --protocol=tcp --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments --database=estoque_laravel < "/Users/silvanioduartedacruz/dump.sql" ERROR 1049 (42000): Unknown database 'estoque_laravel'

Operation failed with exitcode 1 11:02:54 Import of /Users/silvanioduartedacruz has finished with 1 errors```

4 respostas
solução!

Silvânio, você precisa informar o banco de dados onde o dump vai ser importado.

mysql -uroot database < dump.sql

E precisa criar o banco de dados antes também. :)

Espero ter ajudado, bons estudos!

in Connector.php line 55 at PDO->construct('mysql:host=127.0.0.1;port=3306;dbname=homestead', 'homestead', 'secret', array('0', '2', '0', false, false)) in Connector.php line 55 at Connector->createConnection('mysql:host=127.0.0.1;port=3306;dbname=homestead', array('driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'homestead', 'username' => 'homestead', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 24 at MySqlConnector->connect(array('driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'homestead', 'username' => 'homestead', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, 'name' => 'mysql')) in ConnectionFactory.php line 61 at ConnectionFactory->Illuminate\Database\Connectors{closure}() at call_user_func(object(Closure)) in Connection.php line 924 at Connection->getPdo() in Connection.php line 792 at Connection->reconnectIfMissingConnection() in Connection.php line 677 at Connection->run('select from produtos', array(), object(Closure)) in Connection.php line 349 at Connection->select('select from produtos') at call_user_func_array(array(object(MySqlConnection), 'select'), array('select * from produtos')) in DatabaseManager.php line 317 at DatabaseManager->call('select', array('select from produtos')) in Facade.php line 217 at DatabaseManager->select('select from produtos') in Facade.php line 217 at Facade::__callStatic('select', array('select from produtos')) in ProdutoController.php line 13 at DB::select('select from produtos') in ProdutoController.php line 13 at ProdutoController->lista() at call_user_func_array(array(object(ProdutoController), 'lista'), array()) in Controller.php line 80 at Controller->callAction('lista', array()) in ControllerDispatcher.php line 146 at ControllerDispatcher->call(object(ProdutoController), object(Route), 'lista') in ControllerDispatcher.php line 94 at ControllerDispatcher->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96 at ControllerDispatcher->callWithinStack(object(ProdutoController), object(Route), object(Request), 'lista') in ControllerDispatcher.php line 54 at ControllerDispatcher->dispatch(object(Route), object(Request), 'estoque\Http\Controllers\ProdutoController', 'lista') in Route.php line 174 at Route->runController(object(Request)) in Route.php line 140 at Route->run(object(Request)) in Router.php line 724 at Router->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) in VerifyCsrfToken.php line 64 at VerifyCsrfToken->handle(object(Request), object(Closure)) at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 at Pipeline->then(object(Closure)) in Router.php line 726 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699 at Router->dispatchToRoute(object(Request)) in Router.php line 675 at Router->dispatch(object(Request)) in Kernel.php line 246 at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 44 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 at Pipeline->then(object(Closure)) in Kernel.php line 132 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99 at Kernel->handle(object(Request)) in index.php line 54 at require_once('/var/www/html/estoque/public/index.php') in server.php line 21

Estou enfrentando este tipo de erro ao tentar listar os produtos. Mesmo que tente pelo terminal utilizando $desc produtos, o resultado é em branco - diferente do vídeo.

Oi Lucas, esse problema me parece ser muito diferente do que o tópico atual, abre um novo por favor?

Sim Wanderson Macêdo, ja fiz isso. Peço desculpas e aguardo respostas.