If I increase the char value in my mysql database, will it explode?

I have a char (9) column. I want to increase it to char (10). Will it be the hoses of my database? Can you just increase it without a problem in the database? Thank.

+3
source share
3 answers

So far, nothing depends on the 9-character char column. Basically this should be fine (from the point of view of a database that continues to function, it should be fine), but you need to carefully consider if any software uses column width for anything.

eg. if the software expects all values ​​to be 9 characters (and this is not line trimming), you may run into problems.

varchar

+3

char(9) char(10), MySQL , . - , .

+3

Just tried this and there was no need to call the bomb command, lol:

ALTER TABLE `mytable` CHANGE `myfield` `myfield` CHAR(10) CHARSET latin1 COLLATE latin1_swedish_ci NULL; 
+1
source

All Articles