通过laravel连接oracle数据库的问题

问题描述

通过laravel8连接oracle数据库时出现以下错误-

ORA-12154: TNS:could not resolve the connect identifier specified

解决方法

您必须检查您的 oracle 连接的配置。 根据 this,config/database.php 上的有效格式是:

'oracle' => [
    'driver' => 'oracle','host' => 'oracle.host.ip.here','port' => '1521','database' => 'xe','service_name' => 'sid_alias','username' => 'hr','password' => 'hr','charset' => '','prefix' => '',]

如果您不确定在您的情况下必须使用的数据库或服务名称,请询问您的 DBA。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...