#1286 - Unknown storage engine 'InnoDB'

17,162

The MySQL server is generally configured using one of these storage engines:

  • InnoDB (usually default)
  • MyISAM

Other engines exists though.

You problem lays in the ENGINE=InnoDB part of the query. You can eventually try to erase this, if you don't care about the storage engine.

Another solution (the hard one if you don't know about database servers) is to change the storage engine in configuration. If you are able/authorized to do it, configure your database engine using InnoDB. Find the my.cnf file and set default-storage-engine to InnoDB. Other parameters should also be changed in order to make this work (see references).

Note: if your MySQL server already contains data, you need to backup it before.

References:

Share:
17,162
stephen lunzaga
Author by

stephen lunzaga

Updated on June 04, 2022

Comments

  • stephen lunzaga
    stephen lunzaga almost 2 years

    Please help me I get the error

    #1286 - Unknown storage engine 'InnoDB'

    running this query:

        CREATE TABLE IF NOT EXISTS `tbl_prize` (
      `prize_id` int(11) NOT NULL,
      `prize` int(11) NOT NULL,
      `chance` int(11) NOT NULL DEFAULT '1'
    ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
    ALTER TABLE `tbl_prize`  ADD PRIMARY KEY (`prize_id`);
    ALTER TABLE `tbl_prize` MODIFY `prize_id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
    INSERT INTO `tbl_prize` (`prize_id`, `prize`, `chance`) VALUES(1, 100, 1),(2, 200, 1);
    
    CREATE TABLE IF NOT EXISTS `tbl_user` (
      `user_id` int(11) NOT NULL,
      `reffer_id` int(11) DEFAULT NULL,
      `wallet` varchar(500) NOT NULL,
      `ref_pending` int(11) unsigned NOT NULL DEFAULT '0',
      `earn` int(11) unsigned NOT NULL DEFAULT '0',
      `playnum` int(11) unsigned NOT NULL,
      `ip` int(10) unsigned DEFAULT NULL,
      `reset` int(4) unsigned NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    
    ALTER TABLE `tbl_user`
      ADD PRIMARY KEY (`user_id`),
      ADD KEY `reffer_id` (`reffer_id`),
      ADD KEY `username` (`wallet`),
      ADD KEY `ref_pending` (`ref_pending`),
      ADD KEY `ip` (`ip`),
      ADD KEY `reset` (`reset`);
    
    
    ALTER TABLE `tbl_user`
      MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT;
    
    
    ALTER TABLE `tbl_user`
      ADD CONSTRAINT `tbl_user_ibfk_1` FOREIGN KEY (`reffer_id`) REFERENCES `tbl_user` (`user_id`) ON DELETE SET NULL;