How do I specify utf8mb4 for a mySQL column in web2py?

空扰寡人 提交于 2019-12-12 01:43:46

问题


In web2py, how do I make sure that a column of type='string' uses the full 4-byte unicode format (utf8mb4) when creating tables in a mySQL database?


回答1:


From the web2py side, you can specify the encoding via the set_encoding parameter in the connection string:

db = DAL('mysql://username:password@localhost/test?set_encoding=utf8mb4')


来源:https://stackoverflow.com/questions/39349972/how-do-i-specify-utf8mb4-for-a-mysql-column-in-web2py

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