MySQL: “The SELECT would examine more than MAX_JOIN_SIZE rows”

后端 未结 6 1957
长情又很酷
长情又很酷 2020-12-01 18:36

I am using PHP and MySQL. In my program there is a select query involving joins. When I run it on localhost it\'s working fine but when I upload it on my server and try to e

6条回答
  •  独厮守ぢ
    2020-12-01 19:08

    If you are using PDO driver, set the PDO::MYSQL_ATTR_INIT_COMMAND in your driver_options array when constructing a new database handle

    like so:

    $dbh = new PDO('mysql:host=xxx;port=xxx;dbname=xxx', 'xxx', 'xxx', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET SESSION SQL_BIG_SELECTS=1'));
    

提交回复
热议问题