Home >Database >Mysql Tutorial >MySQL Error 1064: Why Is My CREATE TABLE Statement Failing, and How Can I Fix It?
While attempting to create a table, you may encounter the perplexing error 1064. Let's explore the cause and provide a solution for this issue.
The error message indicates a syntax error in the CREATE TABLE statement. Specifically, MySQL no longer supports the TYPE option, which has been deprecated and removed in subsequent versions.
The legacy TYPE option was equivalent to the current ENGINE option. MySQL has removed support for TYPE to promote consistency and streamline the syntax for defining table storage engines.
To resolve this issue, replace the outdated TYPE option with the appropriate ENGINE option. For instance, to create a table using the MyISAM storage engine:
CREATE TABLE dave_bannedwords( id INT(11) NOT NULL AUTO_INCREMENT, word VARCHAR(60) NOT NULL DEFAULT '', PRIMARY KEY (id), KEY id(id) -- this is superfluous in the presence of your PK, ergo unnecessary ) ENGINE = MyISAM ;
By adhering to the current syntax, you can successfully create the desired table without encountering the TYPE-related error.
The above is the detailed content of MySQL Error 1064: Why Is My CREATE TABLE Statement Failing, and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!