Why do I need to use CONVERT USING UTF8 with AES_DECRYPT in select string?

☆樱花仙子☆ 提交于 2020-04-18 05:43:48

问题


I have tested to use AES_DECRYPT on a .asp page and it only showed ???? instead of the descypted value in clear text, when I used this select query.

select *,AES_DECRYPT(thepassword,'myencyptkey2018' ) AS passw from personal

But if I use this with convert using utf8 then it displays the text value.

select *,CONVERT(AES_DECRYPT(thepassword,'myencyptkey2018' ) USING utf8) AS passw from personal

My mySql databas is set to use charset utf8, my .asp uses charset utf8, the connection string as well, as far as I know I'm using utf8 everywhere. So my question is, why do I need to use convert using utf8? Why isn´t the first select code above work? Where in my settings is it not using utf8? If anywhere? Thanks.

This is the variables that you might want to see?

来源:https://stackoverflow.com/questions/60589167/why-do-i-need-to-use-convert-using-utf8-with-aes-decrypt-in-select-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!