Giter Site home page Giter Site logo

Comments (2)

yudukanghe avatar yudukanghe commented on July 20, 2024

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.

qiwsir avatar qiwsir commented on July 20, 2024

from djangopracticeproject.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.