ERROR 1227 (42000) at line 18: Access denied; yo

男儿欲遂平生志,六经勤向窗前读。这篇文章主要讲述ERROR 1227 (42000) at line 18: Access denied; yo相关的知识,希望能为你提供帮助。
mysql导入报错

ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation

产生的原因

grep ^SET test1.sql  
SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;

SET @@SESSION.SQL_LOG_BIN= 0;

SET @@GLOBAL.GTID_PURGED=/*!80000 +*/ 6629f901-5940-11eb-a70a-fa163eda3294:1-689540176;

SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;

[root@dev-nacos databak]#  
解决办法

将grep ^SET test1.sql查询到的注释掉

[root@dev-nacos databak]# sed -i /^SET/i\\/* test1.sql  
[root@dev-nacos databak]# sed -i /^SET/a\\*\\/ test1.sql 
再次执行导入即可
[root@dev-nacos databak]# mysql -uroot -p11111 -h192.168.0.141 test < test1.sql  
mysql: [Warning] Using a password on the command line interface can be insecure.

【ERROR 1227 (42000) at line 18: Access denied; yo】[root@dev-nacos databak]#  

    推荐阅读