Using the TP framework, an error is reported sqlstate [08004] [1040] too many connections

Use
when MySQL inserts a large amount of data and needs to compare and duplicate          Db($table)-> where($where)-> find();

In this case, an error will be reported: sqlstate [08004] [1040] too many connections

This is mainly due to too many database connections

resolvent:

        Introduce DB class

                 use think\Db;

        The query statement is changed to:

                 Db::table($table)-> where($where)-> find();

That’s it

Read More: