槽痞 发布的文章

** 服务器版本号:** centos 7 查看自己服务器版本: ``` [elastic@ecs-d22a-0001 ~]$ uname -a Linux ecs-d22a-0001 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux [elastic@ecs-d22a-0001 ~]$ cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) ```

- 阅读剩余部分 -

在laravel中,如果事务不生效的话,有可能是如下的情况:

  • DB::beginTransaction()是默认用的默认的mysql数据库连接,如果涉及到了跨库的话,则需要指定连接 DB::connection('other-mysql')->commit();,故一定要确认你的数据表的所在mysql连接。