Error Pymysql.err.DataError: (1406, "Data too long for column ' Gender ' at row 1")

Source: Internet
Author: User

When you create a super user in the Django default admin background ,

Error Pymysql.err.DataError: (1406, "Data too long for column ' Gender ' at row 1") workaround.

The creation process is:

Click the Run manage.py Task on the Tool menu, enter Createsuperuser, run, and follow the prompts to enter your username, email, password, and password confirmation.

The workarounds are:

Press the shortcut key ctr+h in Pycharm to find the appropriate field for gender.

  

We can see that the set gender character length is 5, but female has 6 bytes, so modify max_length=10

Then run:

Makemigrations Users

Run again:

Migrate Users

If there's a problem with these two orders, you can look here.

Then we'll go over it again. The creation process is OK.

Error Pymysql.err.DataError: (1406, "Data too long for column ' Gender ' at row 1")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.