Windows mysql启动与停止及group by错误解决

cmd启动mysql

net start mysql

cmd停止mysql

net stop mysql

#my.ini添加

[mysql]
default-character-set=utf8
  
[mysqld]
port = 3306
basedir=D:\Wamp\Mysql-8.0.17
datadir=D:\Wamp\Mysql-8.0.17\data
character-set-server=utf8
default-storage-engine=INNODB

#group查询出错

mysql>select * from `information` group by 'fn';
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ketox.information.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
mysql> select @@sql_mode;
+-----------------------------------------------------------------------------------------------------------------------+
| @@sql_mode                                                                                                            |
+-----------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+-----------------------------------------------------------------------------------------------------------------------+
1 row in set (0.02 sec)
mysql> set @@GLOBAL.sql_mode='';
Query OK, 0 rows affected (0.00 sec)
mysql> set sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';```//复制上面查询的值,去掉ONLY_FULL_GROUP_BY,;
Query OK, 0 rows affected (0.00 sec)

mysql>select * from `information` group by 'fn';
+----+--------+----------------------------------+------------------------+------+-----+------+---------+-------+------------------------+--------+------+-------------------+-----------+-----+-------------------+
| id | isform | csrf_test_name                   | special_coupon_applied | bn   | fn  | ln   | country | state | address                | zpc    | city | email             | phone     | opt | host              |
+----+--------+----------------------------------+------------------------+------+-----+------+---------+-------+------------------------+--------+------+-------------------+-----------+-----+-------------------+
| 79 | 1      | 05e22eae351e4f9e6936be8ed912ea5e | 1                      | buy2 | son | jack | CN      | CN-34 | 广东省深圳市南山区深大 | 518000 | 深圳 | 2768531174@qq.com | 105256525 | 123 | 192.168.1.18:8080 |
+----+--------+----------------------------------+------------------------+------+-----+------+---------+-------+------------------------+--------+------+-------------------+-----------+-----+-------------------+
1 row in set (0.03 sec)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

whaxkl

该打赏续费了

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值