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)