ALTER COMMAND is used to modify an existing MySQL column's data type. Following is an example which demonstrates that how we can use this command to modify column's data type how we can use this command to modify column's data type> #從上述DESCRIBE查詢中,我們可以看到Name欄位的資料型別為CHAR(30)。現在藉助以下查詢的協助,我們可以將其更改為VARCHAR(20) −
mysql> describe testing\G *************************** 1. row *************************** Field: id1 Type: int(11) Null: NO Key: PRI Default: 0 Extra: *************************** 2. row *************************** Field: name Type: char(30) Null: YES Key: Default: NULL Extra: 2 rows in set (0.05 sec)
Now the data type has been modified to VARCHAR(20).
以上是我該如何修改現有的MySQL列的資料類型?的詳細內容。更多資訊請關注PHP中文網其他相關文章!