user cannot run ddl statements on the specified database attmpt to create and drop a table failed
原因:
原因:在mysql5.7中使用了 GTID模式,引入了GTID参数,如下所示
gtid_mode = ON
enforce_gtid_consistency = ON
enforce_gtid_consistency 强制GTID一致性, 启用后以下命令无法再使用
create table ... select ...
但是在hadoop在使用过程中,恰好使用了上述中的建表语句,所以导致了失败。
具体一点就是create table ... select ...在启用强制GTID后,其实是两个独立事件,不符合强一致性的规则,所以创建失败。
解决方法:暂时的解决方案为,由于环境并不是很重要,所以先把GTID模式停了;
gtid_mode = off
enforce_gtid_consistency = off
修改参数后,重新启动数据库。
其它解决方法:把create table ... select 分解为2个sql来进行,即可解决。