' mysql'带有消息的QueryException找不到驱动程序'

发布于 2025-02-07 18:59:01 字数 978 浏览 3 评论 0原文

当我试图运行我的Laravel 8应用程序时,我有例外:

照明\ database \ queryException找不到驱动程序(sql:select

  • 来自inovery_schema.tables where table_schema = gestiondesservicespourccisdt和table_name = types_interventions and type_interventions table_type ='base表')

即使我没有注册extension = pdo_mysqlphp.ini文件中,但我仍然在pdo drivers时找不到它。我检查phpinfo()

我的配置:

php 8.1 Apache 2.4 MySQL 8.0.29

APP_NAME="GestDSR"
APP_ENV=local
APP_KEY=base64:2u3gtLuxhkRS1ninoDLi9Spo/cH9EpXxzuuWdQg/trx=
APP_DEBUG=true
APP_URL=http://192.168.1.120

DB_CONNECTION=mysql
DB_HOST=192.168.1.120
DB_PORT=3306
DB_DATABASE=gestiondesservicespourccisdt
DB_USERNAME=root
DB_PASSWORD=*******

mySQL用户和主机用户:root主机:192.168.1.120

ps:它在本地(127.0.0.1:8000)的工作良好

I have this exception when I am trying to run my laravel 8 app :

Illuminate\Database\QueryException could not find driver (SQL: select

  • from information_schema.tables where table_schema = gestiondesservicespourccisdt and table_name = types_interventions and
    table_type = 'BASE TABLE')

Even I uncommented extension=pdo_mysql in php.ini file but i still can not found it at PDO DRIVERS when i check phpinfo().

My configurations:

PHP 8.1 APACHE 2.4 MYSQL 8.0.29

APP_NAME="GestDSR"
APP_ENV=local
APP_KEY=base64:2u3gtLuxhkRS1ninoDLi9Spo/cH9EpXxzuuWdQg/trx=
APP_DEBUG=true
APP_URL=http://192.168.1.120

DB_CONNECTION=mysql
DB_HOST=192.168.1.120
DB_PORT=3306
DB_DATABASE=gestiondesservicespourccisdt
DB_USERNAME=root
DB_PASSWORD=*******

Mysql user and host user: root host: 192.168.1.120

PS: Its work good at local (127.0.0.1:8000) with php artisan serve

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落叶缤纷 2025-02-14 18:59:01

安装驱动程序

使用以下命令

sudo apt-get安装php8.1-mysql

然后重新启动apache

sudo systemctl restart

Install Driver

using following command

sudo apt-get install php8.1-mysql

Then restart apache

sudo systemctl restart

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文