SQLSTATE [HY000]:一般错误:1835 LARAVEL 上的通信数据包格式错误 [英] SQLSTATE[HY000]: General error: 1835 Malformed communication packet on LARAVEL

查看:30
本文介绍了SQLSTATE [HY000]:一般错误:1835 LARAVEL 上的通信数据包格式错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然得到

SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select * from tb_users where (username = 121211) limit 1)

SQLSTATE[HY000]: General error: 1835 Malformed communication packet (SQL: select * from tb_users where (username = 121211) limit 1)

在 Laravel 上.

on Laravel.

我已经检查过了:MySQL: ERROR 2027 (HY000): Malformed packet,但情况似乎不同.

I already checked this: MySQL: ERROR 2027 (HY000): Malformed packet, but it seems a different case.

  1. 我之前使用 SSH 登录后成功登录 MySQL(使用:mysql -u -p).
  2. 我已成功从远程 PC 直接登录 MySQL(使用:mysql -h [IP] -u -p).

但是我的 Laravel 遇到了我之前提到的错误.有这方面的经验吗?

But my Laravel got the error I mentioned before. Any experience in this?

推荐答案

我所有运行 PHP 7.2 的 Laravel 应用程序都有这个错误,但运行 PHP 7.3 的应用程序没有.于是我把PHP版本改成了7.3,问题就解决了.(运行 Laravel 7)

All my Laravel apps running PHP 7.2 had this error but those running on PHP 7.3 did not. So I changed the PHP version to 7.3 and the problem was fixed. (Running Laravel 7)

这篇关于SQLSTATE [HY000]:一般错误:1835 LARAVEL 上的通信数据包格式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆