MySQL数据库的通信问题,debian托管的Laravel应用程序

发布于 2025-01-25 19:25:28 字数 424 浏览 4 评论 0原文

当我尝试从命令行进行迁移时,我在Debian服务器上托管了Laravel版本9应用程序,报告了驱动程序问题。我安装了PHP8-MYSQL驱动程序并成功地迁移。当我尝试与登录路线连接时,即使已经安装了

Imphuminate \ database \ queryException,也报告了相同的驱动程序问题,找不到驱动程序(sql:select * select * select * from usesuder其中email email =

I have hosted a Laravel version 9 application on a Debian server, when I tried to do the migration from the command line, a driver problem was reported. I installed the PHP8-MySql driver and migrated successfully. When I tried to connect with the login route, the same driver problem was reported even though it was already installed

Illuminate\Database\QueryException could not find driver (SQL: select * from users where email = [email protected] limit 1)

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

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

发布评论

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

评论(1

睫毛上残留的泪 2025-02-01 19:25:28

也许您没有正确安装PHP-MYSQL插件。重新安装:

sudo apt安装php-mysql

,MySQL可能仅在套接字模式下运行。如果是这样,您需要找到MySQL的套接字路径。 这可能会有所帮助。

一旦找到了套接字路径,您就需要在.env文件上定义套接字路径。这 :

DB_SOCKET="/var/lib/mysql/mysql.sock"

Maybe you don't have the php-mysql plugin installed properly. Reinstall by :

sudo apt install php-mysql

Also, it maybe possible that mysql is running in socket mode only. If that is the case, you need to find MySql's socket path. This might help.

Once you've found the socket path, you need to define the socket path on your .env file like this :

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