Comments (2)
1、一开始没设置max_length=......,报错:Data truncated for column 'photo' at row 1") result = self._query(query),
2、猜想和varchar长度有关,开始设置max_length=255,仍然错误
3、猜想是mysql8编码问题,开始配置mysqld.cnf,仍然报错
4、看到上一楼主帖子设置了max_length=10000,遂设置max_length=150000,没报错但图片没显示完全...
5、估算了已经显示的头像部分和未显示的部分比例,遂设置max_length=300000,数据迁移的时候报错了,后来发现了varchar最大是65355
6、面对终端扑面而来的异常,是夜已经快凌晨了,心绪愈加急躁,开始删库,重新迁移数据,到处搜索
7、最后发现,无论如何,migrate的时候,总会有一个warning:....python3.6/site-packages/pymysql/cursors.py:170 (1246,"convertiong column 'photo' from VARCHAR to TEXT") result=self._query(query),重复数据迁移大约半个小时,仍然是这个东西
8、找了半天资料,都没用,最后觉得似乎可以接受这个warning,但是无关紧要为啥要warning呢
9、是夜不知几点了,只能洗澡睡觉了
10、今天本来不打算处理这个问题的,但是午饭后,想想在window环境下看看怎么样?结果还是一样,不过不删库了,知道和那没关系应该,索性再改max_length=60000,在迁移,出乎意料,图片能完全显示了!成功了!
——不知道为啥要设置这么长,然后还有那些让人觉得烦人的warning
from djangopracticeproject.
from djangopracticeproject.
Related Issues (14)
- www.itdiffer.com无法访问 HOT 1
- 源码2.0还有bug
- 内置方法重置密码
- 源码2.0中的Except语句缺少错误类型 HOT 1
- Django 实战 (2017, 第一版) 217页中的数据迁移问题 HOT 2
- 裁剪图片的ajax不能提交 HOT 3
- 课本中实现发布文章后跳转到该新建的文章该怎么做?能麻烦老师解答一下 HOT 3
- Dango实战一书中一个小问题 HOT 1
- Class 'BlogArticles' has no 'objects' member HOT 3
- djang2.0内置登录方法等,已经不用login,loginout HOT 1
- 求更新django2.0中的代码 HOT 1
- 展示个人信息章节,用get()会报错 HOT 1
- 求指点 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangopracticeproject.