【问题标题】:Laravel queue dispatch through error (SQLSTATE[HY000]: General error: 1366 Incorrect string value) while dispatchNow does notLaravel queue dispatch through error (SQLSTATE[HY000]: General error: 1366 Incorrect string value) while dispatchNow 没有
【发布时间】:2020-08-20 14:48:54
【问题描述】:

谁能帮帮我,我想不通。

UpdateVendorProdcutFromXml::dispatchNow($filePath, $class);

工作正常,没有错误。但是

UpdateVendorProdcutFromXml::dispatch($filePath, $class)
            ->onQueue('updating-products')
            ->delay(now()->addSeconds(5))

通过日志中的错误。

(SQLSTATE[HY000]: 一般错误: 1366 字符串值不正确)

【问题讨论】:

  • 可能你没有使用unicode,就像你的数据库中的utf8mb4_unicode_ci 字符集一样。如果上述方法不起作用,请在您的 database.php 中将 'strict' => true 更改为 'strict' => false。然后告诉我
  • 我已经深入挖掘,发现问题与 strtolower() 相关。使用 dispatchNow 运行时没有问题,但是使用 dispatch() 运行时出现“General error: 1366”。 @sta 你知道为什么吗?

标签: queue laravel-7


【解决方案1】:

在 phpmyadmin 中将排序规则添加为 utf8mb4_unicode_ci 到 thos 表字段

【讨论】:

    猜你喜欢
    • 2019-02-27
    • 1970-01-01
    • 2021-01-09
    • 1970-01-01
    • 2020-11-18
    • 2012-10-10
    • 2021-10-15
    • 1970-01-01
    • 2016-08-10
    相关资源
    最近更新 更多