Mysql权限问题&Access denied for user'root'@'IP地址&GROUP BY clause and contains nonaggregated column

解决mysql”Access denied for user’root’@’IP地址’”问题
GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘123’ WITH GRANT OPTION;
FLUSH PRIVILEGES;

解决视图权限问题
mysql> grant all privileges on . to root@”%” identified by “.”;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘cmp-31161029.t1.user_name’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by, Time: 0.000000s

原因:
select @@global.sql_mode
结果:
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

去除 ONLY_FULL_GROUP_BY重新 设置sql_mode
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’

猜你喜欢

转载自blog.csdn.net/shenhonglei1234/article/details/80810244