数据库版本是5.7.19,在写语句的时候,只要涉及ORDER BY,就会报错,

ERROR 1055 (42000): Expression #7 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'postscan.verifyDelayLog.auditor' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

这个时候,百度发现,是因为这个版本的mysql 数据库默认开启了 sql_mode 字段的only_full_group_by 属性。这个属性是在你写语句时,当你 ORDER BY 的字段不在select 的字段当中,都会报错。

sql_mode 属性是在mysql数据库,event表中,

点进去,可以看到默认属性是

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

解决这个问题,就需要修改这个字段的属性。

方法一

在navicat 里面直接针对event表进行修改

set GLOBAL sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION ';

这样就能去掉only_full_group_by 字段。但弊端是这个方法是针对session的,也就是说每次连接mysql 前,都需要set一次。

方法二

修改配置mysql的文件

mac在安装这个版本的mysql的时候,我没有发现mysql 的配置文件。不管是

/etc 下还是 mysql 的support-files 下都没有

这个时候,可以自己在etc目录下创建一个

关闭mysql

sudo vim /etc/my.cnf

然后往文件里写这个配置就ok。

# Example MySQL config file for medium systems.

#

# This is for a system with little memory (32M - 64M) where MySQL plays

# an important part, or systems up to 128M where MySQL is used together with

# other programs (such as a web server)

#

# MySQL programs look for option files in a set of

# locations which depend on the deployment platform.

# You can copy this option file to one of those

# locations. For information about these locations, see:

# http://dev.mysql.com/doc/mysql/en/option-files.html

#

# In this file, you can use all long options that a program supports.

# If you want to know which options a program supports, run the program

# with the "--help" option.

# The following options will be passed to all MySQL clients

[client]

default-character-set=utf8

#password = your_password

port = 3306

socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

[mysqld]

character-set-server=utf8

init_connect='SET NAMES utf8

port = 3306

socket = /tmp/mysql.sock

skip-external-locking

key_buffer_size = 16M

max_allowed_packet = 1M

table_open_cache = 64

sort_buffer_size = 512K

net_buffer_length = 8K

read_buffer_size = 256K

read_rnd_buffer_size = 512K

myisam_sort_buffer_size = 8M

character-set-server=utf8

sql_mode='NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES'

init_connect='SET NAMES utf8'

# Don't listen on a TCP/IP port at all. This can be a security enhancement,

# if all processes that need to connect to mysqld run on the same host.

# All interaction with mysqld must be made via Unix sockets or named pipes.

# Note that using this option without enabling named pipes on Windows

# (via the "enable-named-pipe" option) will render mysqld useless!

#

#skip-networking

# Replication Master Server (default)

# binary logging is required for replication

log-bin=mysql-bin

# binary logging format - mixed recommended

binlog_format=mixed

# required unique id between 1 and 2^32 - 1

# defaults to 1 if master-host is not set

# but will not function as a master if omitted

server-id = 1

# Replication Slave (comment out master section to use this)

#

# To configure this host as a replication slave, you can choose between

# two methods :

#

# 1) Use the CHANGE MASTER TO command (fully described in our manual) -

# the syntax is:

#

# CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,

# MASTER_USER=, MASTER_PASSWORD= ;

#

# where you replace , , by quoted strings and

# by the master's port number (3306 by default).

#

# Example:

#

# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,

# MASTER_USER='joe', MASTER_PASSWORD='secret';

#

# OR

#

# 2) Set the variables below. However, in case you choose this method, then

# start replication for the first time (even unsuccessfully, for example

# if you mistyped the password in master-password and the slave fails to

# connect), the slave will create a master.info file, and any later

# change in this file to the variables' values below will be ignored and

# overridden by the content of the master.info file, unless you shutdown

# the slave server, delete master.info and restart the slaver server.

# For that reason, you may want to leave the lines below untouched

# (commented) and instead use CHANGE MASTER TO (see above)

#

# required unique id between 2 and 2^32 - 1

# (and different from the master)

# defaults to 2 if master-host is set

# but will not function as a slave if omitted

#server-id = 2

#

# The replication master for this slave - required

#master-host =

#

# The username the slave will use for authentication when connecting

# to the master - required

#master-user =

#

# The password the slave will authenticate with when connecting to

# the master - required

#master-password =

#

# The port the master is listening on.

# optional - defaults to 3306

#master-port =

#

# binary logging - not required for slaves, but recommended

#log-bin=mysql-bin

# Uncomment the following if you are using InnoDB tables

#innodb_data_home_dir = /usr/local/mysql/data

#innodb_data_file_path = ibdata1:10M:autoextend

#innodb_log_group_home_dir = /usr/local/mysql/data

# You can set .._buffer_pool_size up to 50 - 80 %

# of RAM but beware of setting memory usage too high

#innodb_buffer_pool_size = 16M

#innodb_additional_mem_pool_size = 2M

# Set .._log_file_size to 25 % of buffer pool size

#innodb_log_file_size = 5M

#innodb_log_buffer_size = 8M

#innodb_flush_log_at_trx_commit = 1

#innodb_lock_wait_timeout = 50

[mysqldump]

quick

max_allowed_packet = 16M

[mysql]

no-auto-rehash

# Remove the next comment character if you are not familiar with SQL

#safe-updates

default-character-set=utf8

[myisamchk]

key_buffer_size = 20M

sort_buffer_size = 20M

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout

mac mysql57 配置文件_Mac 的mysql5.7没有配置文件,如何解决only_full_group_by 问题相关推荐

  1. mac mysql 移动硬盘_Mac的移动硬盘不能装载该如何解决?

    昨天拔硬盘时,不能弹出,赶着要睡觉,就直接拔掉USB接口,谁料到今天再插进去,电脑不能识别,无法装载了. 我的天那, 里面很多重要资料,我以为硬盘坏了,要重新格盘了...T T 还好在网上找到了大神们 ...

  2. mac10.12 安装mysql_在mac os10.12上安装mysql5.7.18

    会提示 command not found, 然后输入 alias mysql=/usr/local/mysql/bin/mysql alias mysqladmin=/usr/local/mysql ...

  3. mysql 多实例 独立配置文件_三、安装配置多实例MYSQL5.6-多独立配置文件方法

    三.安装配置多实例MYSQL5.6-多独立配置文件方法 1.准备工作 检查操作系统版本.内核版本.selinux是否关闭.防火墙策略.IP地址.主机名配置.host表配置.yum配置 上传cmake. ...

  4. MySQL-5.5.32 配置文件优化详解

    目录 MySQL-5.5.32 配置文件优化详解 一.配置文件说明 2.my-medium.cnf 3.my-large.cnf 4.my-huge.cnf 5.my-innodb-heavy-4G. ...

  5. mysql5.7的配置文件优化参考

    mysql5.7的配置文件优化,引用了别人的模板,根据自己的情况修改了一些参数,加上注释,留着备用,感兴趣的朋友可以借鉴一下,如果无法启动可以查看一下error_log,修改相应的参数. #innod ...

  6. easyconnect无法在mac上使用_Mac上Python无法输入中文- 2017年

    [Mac OS 10.13 版本] 一.[官网下载]非Homebrew [Python 3.6.3版本] 下载地址:Download Python-3.6.3-macosx10.6.pkg 与之对应的 ...

  7. 配置文件没有关闭保护模式_配置文件:PS自带的海量滤镜 | 照片调色宝典13

    本次是该系列第13篇文章,在讲解了Adobe Camera Raw中很多调色原理后,今天我们来说一个很"爽"的功能:它自带47个(如果我没数错)滤镜效果,这个功能就是"配 ...

  8. 关于mac双系统安装SQL Server卡在starting server的解决办法

    关于mac双系统安装SQL Server卡在starting server的解决办法 因为本人有时候会做一些设计的公司,奔着mac系统的稳定性,购置了一台macbook Pro2017年出厂的一款本, ...

  9. mysql5.7 only_full_group_by_MySQL5.7默认打开ONLY_FULL_GROUP_BY模式问题与解决方案

    MySQL5.7后将sql_mode的ONLY_FULL_GROUP_BY模式默认设置为打开状态,这样一来,很多之前的sql语句可能会出现错误,错误信息如下: Error Code: 1055. Ex ...

  10. 【C 语言】文件操作 ( 配置文件读写 | 写出或更新配置文件 | 追加键值对数据 | 更新键值对数据 )

    文章目录 一.追加键值对数据 二.更新键值对数据 三.完整代码示例 一.追加键值对数据 在上一篇博客 [C 语言]文件操作 ( 配置文件读写 | 写出或更新配置文件 | 逐行遍历文件文本数据 | 获取 ...

最新文章

  1. php 声明字符串的三种方式
  2. 计算机科学学什么语言,在计算机科学中,什么不是正式语言? [关闭]
  3. 浅谈iPhone和iPad开发中的图标设置
  4. VS2008下最新X264(svn 2009.0216)编译不过的解决办法(附编译通过+修改内存泄露版本)
  5. Nacos 计划发布v0.2版本,进一步融合Dubbo和SpringCloud生态
  6. 【华为云技术分享】【昇腾】【玩转Atlas200DK系列】Atlas 200 DK安装python的hiai库以及opencv
  7. json 解析_json爬坑1:yajl解析json
  8. centos8离线安装Apache_疯狂Hive之Hivean安装部署与交互方式(一)
  9. Rust创建项目的两种方式
  10. 缓冲文件系统和非缓冲文件系统
  11. python 时间模块 -- time
  12. 强大的Windows 10数字权利获取工具HWIDGEN
  13. IT6561 IT6563 IT6562 IT6564系列 DP转HDMI
  14. 大数据hive篇--同比环比
  15. 容器中的 Shim 到底是个什么鬼?
  16. Ubuntu系统如何屏幕截图
  17. 水箱建模最小二乘法_高位消防水箱考点汇总及历年真题!
  18. 《Think Python》练习 4-1:本章示例代码栈图、停止点偏离思考
  19. 一二, Spark概述和快速入门
  20. Linux下查看内存泄露的命令

热门文章

  1. 力扣-746. 使用最小花费爬楼梯
  2. Java 总结,会不断更新
  3. Flutter高级第5篇:官方推荐的状态管理库 provider 的使用
  4. linux v4l2进行视频采集编程介绍
  5. hadoop常见问题汇总
  6. 全栈project师的毁与誉
  7. 1.1 OC类的认识
  8. UI基础UIView常见属性及方法
  9. 系统监控技术 -- 主机监控,信息转发,前台显示
  10. H3C IS-IS实验