MySQL dynamically modifies the varchar Length

Source: Internet
Author: User

Although this situation should not happen, we should have designed it in advance and won't be able to change it in the future, but due to the negligence of our previous work, to be honest, it is not only my personal negligence, but also the communication reasons. Of course, the database is designed by me after all. Therefore, I should criticize myself.

Let's talk about the situation: the MySQL field has a varchar value field set too short, set 30 (I vaguely remember that varchar is scalable, of course, the reality does not allow me to vaguely), so I can only find one way to dynamically modify the length of the varchar field while keeping the database data unchanged, finally let me find it.

Alter table name modify column field name varchar (Quantity );

This feature is still quite powerful, but we still remind you not to have this problem during the best design.

Related Article

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.