mots mots - 6 months ago 28
MySQL Question

recreating mysql database from a schema

I am trying to recreate a database from a schema.sql file but I'm getting the error

ERROR 1193 (HY000) at line 22: Unknown system variable 'storage_engine'


here is the schema.sql file.

SET SESSION storage_engine = "InnoDB";
SET SESSION time_zone = "+0:00";
ALTER DATABASE CHARACTER SET "utf8";

DROP TABLE IF EXISTS entries;
CREATE TABLE entries (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
author_id INT NOT NULL REFERENCES authors(id),
slug VARCHAR(100) NOT NULL UNIQUE,
title VARCHAR(512) NOT NULL,
markdown MEDIUMTEXT NOT NULL,
html MEDIUMTEXT NOT NULL,
published DATETIME NOT NULL,
updated TIMESTAMP NOT NULL,
KEY (published)
);

DROP TABLE IF EXISTS authors;
CREATE TABLE authors (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(100) NOT NULL UNIQUE,
name VARCHAR(100) NOT NULL,
hashed_password VARCHAR(100) NOT NULL
);


what could be the problem?

Answer Source

According to https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_storage_engine

This variable is deprecated as of MySQL 5.5.3. Use default_storage_engine instead.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download