之前一直使用的mysql5,突然换成8之后,有许多地方不一样,今天就碰到一个。

在使用sql语句创建表时,报错:

 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

 

 

网上找了下处理的方法,大体有两种:一种是直接改配置文件(永久性的),另一种是使用sql语句来设置(临时性)

修改配置文件:在配置文件里加一句就可以了:sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

以上语句不要写错哦,错了服务启动不了,我就是因为写错搞了好久

  windows的在安装目录里找到my.ini,添加进去后,关掉mysql服务重启

    关:net stop mysql     

              启:net start mysql     

    (注意:mysql是你服务的名称)

       centos7在/etc/my.cnf中添加,重启

           service mysqld restart或者 systemctl restart mysqld

在window和centos7上,我都设置了,之后就不会报错 ^_^

我在创建表时,报了这个错,但还是创建成功了,不晓得是为甚 ?

 

posted on 2018-12-31 15:05  skyxia  阅读(8267)  评论(1编辑  收藏  举报