以下是数据示例:
{'rate': 0.008999, 'stamp': {'bids': [[117090.0, 11.78362353], [117075.0, 0.28], [116918.0, 0.5],[116820.0, 32.0]], 'asks': [[117104.0, 0.55206666], [117105.0, 1.11], [117142.0, 4.99974999], [117178.0, 1.0], [117191.0, 0.0669], [117348.0, 0.01], [117369.0, 1.05]]}}我想在PythonAnywhere上托管记录器。我是mysql的新手。从版本5.7.8开始,添加JSON对象的方式是pythonanywhere使用5.6.27。
我得到了这个错误:ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syn tax to use near 'JSON)' at line 1
所以我想把它存储为字符串VARCHAR。但是,您必须指定长度,每个条目的长度都有所不同。那么我应该把长度设为65,535吗?
发布于 2017-03-23 16:23:33
通常,Json在Mysql DB中存储为NVARCHAR
发布于 2017-03-23 16:24:43
json你可以尝试改变你的VARCHAR为文本,因为固定的最大大小是2²characters.
发布于 2017-03-23 16:29:40
https://stackoverflow.com/questions/42970558
复制相似问题