Looking at examples of a standard SQL layout I see this:
CREATE TABLE IF NOT EXISTS siteUser (
id int(11) AUTO_INCREMENT PRIMARY KEY,
email varchar(64) NOT NULL UNIQUE KEY,
password varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT;
What is th purpose of the "DEFAULT" at the end of specifying the engine? Is there any need for it? I tried to find an explanation of it on tutorial websites but I didn't have any luck.
James
It is used to set ENGINE=InnoDB as the default engine. So one way is to either remove the Engine = INNODB from your create table statement
CREATE TABLE IF NOT EXISTS siteUser (
id int(11) AUTO_INCREMENT PRIMARY KEY,
email varchar(64) NOT NULL UNIQUE KEY,
password varchar(255) NOT NULL
)
Or the other way which GolezTrol
has suggested:
CREATE TABLE IF NOT EXISTS siteUser (
id int(11) AUTO_INCREMENT PRIMARY KEY,
email varchar(64) NOT NULL UNIQUE KEY,
password varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT charset = utf8;
From the Manual: InnoDB as the Default MySQL Storage Engine
In previous versions of MySQL, MyISAM was the default storage engine. In our experience, most users never changed the default settings. With MySQL 5.5, InnoDB becomes the default storage engine. Again, we expect most users will not change the default settings. But, because of InnoDB, the default settings deliver the benefits users expect from their RDBMS: ACID Transactions, Referential Integrity, and Crash Recovery.
However if you want to make the INNODB as your deafult engine then there is one other way:
Under [mysqld] section in your ini file, add:
default-storage-engine = innodb
It is there in /etc/my.cnf
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments