![ca1abc2d20a3b4c1778753fef6df7278.png](https://i-blog.csdnimg.cn/blog_migrate/2b6a469fda802764a71f1289b8a0031a.jpeg)
工作环境:MySql5.7
[SQL]create DATABASE mytest;
受影响的行: 1
时间: 0.001s
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
建立数据库,能成功建立,但是报错。
解决方法:
修改my.ini,加入如下代码,重启mysql服务
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
修改后的配置文件全文如下:
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=D:mysql-5.7.23-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:mysql-5.7.23-winx64data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION