解决PDOException in Connection.php line 687 sqlstate[42000]: syntax error or access violation: 1055

测试简约强大的贷超系统/海豚DolphinPHP开发/渠道注册量/渠道分析等/全开源无授权源码的时候,前台好好的,我去后台登陆的时候报sqlstate[42000]: syntax error or access violation: 1055。。。。。。错误,错误如下,一看就是数据库问题然后百度了下,找到了如下办法:

完美解决办法:

在对应数据库版本的my.ini中添加sql_mode=""然后保存,再重启mysql服务即可完美解决。

解决PDOException in Connection.php line 687 sqlstate[42000]: syntax error or access violation: 1055 教程 第1张

 

解决PDOException in Connection.php line 687 sqlstate[42000]: syntax error or access violation: 1055 教程 第2张

[10501] PDOException in Connection.php line 687

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '127002.apply.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

  1. $this->debug(false, '', $master);

  2. // 返回结果集
  3. return $this->getResult($pdo, $procedure);
  4. } catch (PDOException $e) {
  5. if ($this->isBreak($e)) {
  6. return $this->close()->query($sql, $bind, $master, $pdo);
  7. }

  8. throw new PDOException($e, $this->config, $this->getLastsql());
  9. } catch (Throwable $e) {
  10. if ($this->isBreak($e)) {
  11. return $this->close()->query($sql, $bind, $master, $pdo);
  12. }

  13. throw $e;
  14. } catch (Exception $e) {
  15. if ($this->isBreak($e)) {
  16. return $this->close()->query($sql, $bind, $master, $pdo);