mysql - SQLSTATE[HY000]:一般错误:1436 共享主机上的线程堆栈溢出
问题描述
嗨,我正在使用这个 Laravel 包https://github.com/nicolaslopezj/searchable
这是我的代码:
$RelatedProducts = Product::where('product_status', 1)
->search($product->product_name)
->with('images')
->take(10)->get();
它在我的本地机器 (XAMPP-Windows) 上运行良好,但在我的 Linux 共享主机上运行良好
当我正在寻找大的东西时,它会返回此错误:
我想我必须更改 SQL 配置文件,但是在共享主机上他们不允许这样做,有没有其他方法可以做到这一点?
SQLSTATE[HY000]: General error: 1436 Thread stack overrun: 230160 bytes used of a 262144 byte stack, and 32000 bytes needed.
解决方案
解决方案
您应该将 thread_stuck 提高到 512k,这通常足以永久避免此问题。
备份并编辑my.cnf,找到thread_stack指令并修改为512k
重启 MySQL 服务以重新加载新配置
运行您的 PHP 脚本或再次测试
推荐阅读
- docker - Minishift:无法登录到 docker 内部镜像注册表
- mysql - MySQL 触发器 - 获取 json 字段的新旧值之间的差异
- php - php password_hash 中允许的最大成本是多少?
- laravel - laravel 使用管理员角色进行多重身份验证
- user-experience - Ant design 3.12.0 草图文件
- python-3.x - 如何比较不同数据框的列?
- performance - 请求/响应的 Kafka 消息时间戳
- javascript - 仅使用 datepicker 出现在 chrome android 中的错误
- r - 使用 R 通过电子邮件发送表格
- java - 将 mysql 数据源添加到 jboss AS 7