Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 1193 when following 'employees database' install tutorial with MySQL 5.7.11

Tags:

mysql

I downloaded and installed a vanilla instance of MySQL 5.7.11 (that's the version it reports when I run > mysql -v). The instance is up and running.

Then I tried to follow the seemingly simple tutorial here: https://dev.mysql.com/doc/employee/en/employees-installation.html

When I get to the step to run: mysql -t < employees.sql it fails, giving the error:

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

The employees.sql file is configured as instructed in the tutorial with the default setting. How do I fix this error?

Note: I'm performing all steps as root in MySQL, and the system is Win10 if that has any bearing.

like image 653
Steverino Avatar asked Mar 31 '16 02:03

Steverino


3 Answers

The tutorial hasn't been updated to reflect changes in recent MySQL versions. From the documentation

This variable is deprecated and was removed in MySQL 5.7.5. Use default_storage_engine instead.

like image 101
Barmar Avatar answered Sep 30 '22 17:09

Barmar


If anyone cares to know the fix without finding the updated archive it's relatively simple:

  1. Open the employees.sql file in your editor of choice

  2. Edit lines 38 and 44

    // change line 38 from:
    set storage_engine = InnoDB;
    // to:
    set default_storage_engine = InnoDB;
    
    // change line 44 from:
    select CONCAT('storage engine: ', @@storage_engine) as INFO;
    // to:
    select CONCAT('default storage engine: ', @@default_storage_engine) as INFO;
    
  3. Save employees.sql, then open a console window and navigate to the employees_db folder. Execute the following command from the prompt and your all set.

c:\employees_db>c:\Path\to\MySql\bin\mysql.exe -u username -p < employees.sql

like image 30
macrolyte Avatar answered Sep 30 '22 17:09

macrolyte


[root@001 employees_db]# vim employees.sql

set **default_storage_engine** = InnoDB;

-- set storage_engine = MyISAM;

-- set storage_engine = Falcon;

-- set storage_engine = PBXT;

-- set storage_engine = Maria;



select CONCAT('storage engine: ', @@**default_storage_engine**) as INFO;

Two changes needed : default_storage_engine

like image 35
Bob Yu Avatar answered Sep 30 '22 19:09

Bob Yu