mysql:Illegal mix of collations错误

2 篇文章 0 订阅
错误信息
Illegal mix of collations (gb2312_chinese_ci,IMPLICIT)
 and (latin1_swedish_ci,COERCIBLE) for operation '='
//错误信息:字段字符集编码不同,不合法的连接
  1. show full columns from user;命令查看tenant表各个字段的字符编码
  2. alter table user convert to character set utf8;转换整个表的字段为utf8编码
  3. ALTER TABLE user CHANGE username username VARCHAR( 32) CHARACTER SET gb2312 COLLATE gb2312_bin NOT NULL 命令修改user表中的username字段的字符编码为gb2312类型。保证与整个数据库的字符编码gb2312一致。
在进行SQL注入时,你遇到了报错信息:"Illegal mix of collations for operation 'UNION'"。根据引用中的解决办法,这个问题是因为information_schema数据库中的表使用的字符集(collation)与目标网站user表中的字符集不一致导致的。解决方法是将user表中的字符集与information_schema数据库一致。需要注意的是,不仅仅需要更改表的字符集,还需要逐一更改每一个字段的字符集。 在实际实战中,如果无法更改目标网站的数据库,可以使用16进制的方式读取数据。根据引用中的实际测试,可以使用类似的payload和url来进行查询,并使用在线加解码工具解码返回结果。 如果你在修改字符集后仍然遇到相同的报错信息,可以参考引用中的方法。该方法使用SQL查询语句来生成修改表字段字符集的语句,可以批量修改表的字段字符集。你需要根据你自己的实际情况修改查询语句中的数据库名和字符集信息。 综上所述,你可以根据引用中提供的方法来解决报错信息"error:Illegal mix of collations for operation 'UNION'"。123 #### 引用[.reference_title] - *1* [SQL注入报错:Illegal mix of collations for operation ‘UNION‘ (sqli-labs靶场MySQL数据库)](https://blog.csdn.net/m0_47470899/article/details/118695774)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] - *2* [关于SQL注入报错:Illegal mix of collations for operation ‘UNION‘原因剖析与验证](https://blog.csdn.net/qq_43665434/article/details/114088565)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] - *3* [MySQLSQL error1271Illegal mix of collations for operation UNION](https://blog.csdn.net/yyj108317/article/details/106427128)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值