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

Erro Banco

Srs, bom dia.

Eu tenho uma aplicação que usa mais de um banco. Eu fiz a inclusão de um novo banco de dados SQL fiz a configurações no env e config, porem estou com o erro abaixo. Se alguém puder me ajuda eu agradeço.

[2018-12-27 13:52:33] production.ERROR: SQLSTATE[HY000] Unknown host machine name (severity 2) {"exception":"[object] (PDOException(code: 20013): SQLSTATE[HY000] Unknown host machine name (severity 2) at /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:67)
[stacktrace]
#0 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(67): PDO->__construct('dblib:host=192....', 'SYSADM', 'SYSADM', Array)
#1 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(43): Illuminate\\Database\\Connectors\\Connector->createPdoConnection('dblib:host=192....', 'ADM', ADM', Array)
#2 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connectors/SqlServerConnector.php(32): Illuminate\\Database\\Connectors\\Connector->createConnection('dblib:host=192....', Array, Array)
#3 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\\Database\\Connectors\\SqlServerConnector->connect(Array)
#4 [internal function]: Illuminate\\Database\\Connectors\\ConnectionFactory->Illuminate\\Database\\Connectors\\{closure}()
#5 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func(Object(Closure))
#6 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(940): Illuminate\\Database\\Connection->getPdo()
#7 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(399): Illuminate\\Database\\Connection->getReadPdo()
#8 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(325): Illuminate\\Database\\Connection->getPdoForSelect(true)
#9 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('select top 1 * ...', Array)
#10 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\\Database\\Connection->runQueryCallback('select top 1 * ...', Array, Object(Closure))
#11 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\\Database\\Connection->run('select top 1 * ...', Array, Object(Closure))
#12 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1705): Illuminate\\Database\\Connection->select('select top 1 * ...', Array, true)
#13 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1690): Illuminate\\Database\\Query\\Builder->runSelect()
#14 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(479): Illuminate\\Database\\Query\\Builder->get(Array)
#15 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(463): Illuminate\\Database\\Eloquent\\Builder->getModels(Array)
#16 #21 #24 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Routing/Route.php(169): Illuminate\\Routing\\Route->runController()
#25 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\\Routing\\Route->run()
#26 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#27 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#28 /var/www/cep2/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(149): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#29 /var/www/cep2/vendor/laravel/framework/
2 respostas

Complemento, obrigado

.env

COTACAO_FRETE_HOST=192.168.11.72\SOCHI
COTACAO_FRETE_DATABASE=CotacaoFrete
COTACAO_FRETE_USERNAME=?
COTACAO_FRETE_PASSWORD=?
'cotacaoFrete' => [
            'driver' => 'sqlsrv',
            'host' => env('COTACAO_FRETE_HOST', 'localhost'),
            'port' => env('COTACAO_FRETE_PORT', '1433'),
            'database' => env('COTACAO_FRETE_DATABASE', 'forge'),
            'username' => env('COTACAO_FRETE_USERNAME', 'forge'),
            'password' => env('COTACAO_FRETE_PASSWORD', ''),
            'charset' => 'latin1',
            'prefix' => '',
        ],
solução!

Srs, eu achei o erro. Na minha conexão eu estava passando a porta no mysql e por algum motivo gerava esse erro, então eu comentei e passou.

Esta foi a linha comentada em condig\database.php

   'port' => env('COTACAO_FRETE_PORT', '1433'),