首页 > 解决方案 > SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified in Laravel

问题描述

安装后composer require moodlesbv/laravel-msaccess并按照有关如何设置连接的说明进行操作。我已经下载了accessdatabaseengine_X64,并且已经在 ODBC 数据源 (x64) 中设置了数据源,但是我收到了这个错误。

Laravel 6,PHP 7.4

exception: "Doctrine\DBAL\Driver\PDO\Exception"
file: "C:\xampp\htdocs\hris_mirdc\hris\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php"
line: 18
message: "SQLSTATE[IM002] SQLDriverConnect: 0 [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

database.php配置文件

'connections' => [
    'access' => [
        'driver' => 'pdo_access',
        'connection_string' => 'dsn={UNIS}',
        'username' => 'unisuser',
        'password' => 'unisamho',
        'table_prefix' => '',
    ]
],

这是phpinfo

标签: laravelms-access

解决方案


推荐阅读