我尝试使用我的 Laravel 应用程序连接外部数据库并收到以下错误消息:
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from information_schema.tables where table_schema = lextern and table_name = migrations)
[PDOException]
could not find driver
连接:
DB_CONNECTION=mysql
DB_HOST=db_ip
DB_PORT=3306
DB_DATABASE=lextern
DB_USERNAME=lextern_root
DB_PASSWORD=db_pw
如果我从本地主机执行此操作,那么它就可以工作...
我没有在服务器上安装mysql,但希望连接外部数据库,我还需要在我的服务器上设置一些东西吗?
最佳答案
您的外部数据库服务器没有 mysql 服务器或者它没有运行。
sudo /etc/init.d/mysql start
将启动服务器。
关于php - Laravel 连接外部数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41324393/