February 2018
Intermediate to advanced
510 pages
16h 10m
English
As mentioned earlier, MySQL 8 doesn't support the YEAR(2) type. Trying to create a column with YEAR(2) as a data type will give an error as follows:
mysql> CREATE TABLE temp(year YEAR(2));ERROR 1818 (HY000): Supports only YEAR or YEAR(4) column.
The ALTER TABLE query, which rebuilds the table, will automatically convert YEAR(2) to YEAR(4). The YEAR(2) column, after upgrading the database to the MySQL 8 database, remains as YEAR(2), but the queries give errors.
There are multiple ways to migrate from YEAR(2) to YEAR(4):
Read now
Unlock full access