MySQL – table becomes immutable after adding a field with the ENUM type

Question:

Through Phpmyadmin added a new field with the ENUM type to the table structure with a fairly large number of elements. 4 not very long values. Also set one of them as the default.

There were two problems:

  1. Phpmyadmin no longer displays the structure of this table acc. tab. It seems to ignore the click on the tab, but does not hang at the same time.
  2. Attempts to make changes to the fields of this table are unsuccessful. There are no errors, but the values ​​do not change.

Previously, everything was fine with the table, the data was installed and received quickly. The point is in ENUM since removing it through DROP COLUMN I get a working table.

I thought ENUM is an economical type and does not load the database very much?

Answer:

Using ENUM in MySQL is highly discouraged. It is better to store the field data as integers. A separate page can be created to store the values. Also adding new values ​​to ENUM will result in alter table.

Scroll to Top