I have a table that describes like this:
mysql> describe easy_table;
+---------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| version | bigint(20) | NO | | NULL | |
| account_id | bigint(20) | NO | MUL | NULL | |
| city | varchar(30) | NO | | NULL | |
...
| name | varchar(255) | YES | | NULL | |
| name_two | varchar(255) | YES | | NULL | |
+---------------------+--------------+------+-----+---------+----------------+
13 rows in set (0.03 sec)
I'm trying to make the city varchar bigger to varchar(100) and this line doesn't work
alter table easy_table alter column city varchar(100);
this also doesn't work
alter table easy_table alter column city varchar(100) not null;
I get this error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(100)' at line 1
alter table easy_table modify column city varchar(100) not null;