<p>If you're trying to install Craft directly onto a MySQL box that has MyISAM disabled, you can either:</p>
<ol>
<li>Modify Craft's install migration at <code>vendor/craftcms/cms/src/migrations/Install.php</code></li>
</ol>
<p>Find this:</p>
<pre><code>// Add the FULLTEXT index on searchindex.keywords
$this-&gt;createTable(Table::SEARCHINDEX, [
    'elementId' =&gt; $this-&gt;integer()-&gt;notNull(),
    'attribute' =&gt; $this-&gt;string(25)-&gt;notNull(),
    'fieldId' =&gt; $this-&gt;integer()-&gt;notNull(),
    'siteId' =&gt; $this-&gt;integer()-&gt;notNull(),
    'keywords' =&gt; $this-&gt;text()-&gt;notNull(),
], ' ENGINE=MyISAM');
</code></pre>
<p>Change it to this:</p>
<pre><code>// Add the FULLTEXT index on searchindex.keywords
$this-&gt;createTable(Table::SEARCHINDEX, [
    'elementId' =&gt; $this-&gt;integer()-&gt;notNull(),
    'attribute' =&gt; $this-&gt;string(25)-&gt;notNull(),
    'fieldId' =&gt; $this-&gt;integer()-&gt;notNull(),
    'siteId' =&gt; $this-&gt;integer()-&gt;notNull(),
    'keywords' =&gt; $this-&gt;text()-&gt;notNull(),
]);
</code></pre>
<p>Then do the installation, or:</p>
<ol start="2">
<li>Do the Craft installation on a local dev environment that supports MyISAM, convert the <code>searchindex</code> table to InnoDB using your favorite MySQL client, then restore that database to the box that doesn't support MyISAM.</li>
</ol>

CC BY-SA 4.0
2021-11-20T00:45:52.407Z
2021-11-20T00:45:52.407Z
Brad Bell
<p>I just cloned an existing droplet with a working instance of Craft, I created a MySQL8 managed DB but whenever I run <code>php ./craft setup</code> I get this error:</p>
<pre><code>Caused by: Exception 'yii\db\Exception' with message 'SQLSTATE[HY000]: General error: 3161 Storage engine MyISAM is disabled (Table creation is disallowed).
The SQL being executed was: CREATE TABLE `searchindex` (
    `elementId` int(11) NOT NULL,
    `attribute` varchar(25) NOT NULL,
    `fieldId` int(11) NOT NULL,
    `siteId` int(11) NOT NULL,
    `keywords` text NOT NULL
)  ENGINE=MyISAM DEFAULT CHARACTER SET = utf8'

in /srv/gentri/vendor/yiisoft/yii2/db/Schema.php:678

Error Info:
Array
(
    [0] =&gt; HY000
    [1] =&gt; 3161
    [2] =&gt; Storage engine MyISAM is disabled (Table creation is disallowed).
)

Caused by: Exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 3161 Storage engine MyISAM is disabled (Table creation is disallowed).'
</code></pre>
<p>I understand that MyISAM is not as widely supported as InnoDB but that <code>searchindex</code> requires it because it is full text searchable. But I'm wondering how I can set Craft up with this restriction?  If I run <code>show engines</code> in the database I can see that the DB is configured the exact same way as another Craft instance which is working perfectly fine.  I'm also wondering why I've never run into this before when working with DigitalOcean's managed dbs.</p>

<mysql><deployment><digitalocean>
Unable to setup Craft on a DigitalOcean managed DB
# Unable to setup Craft on a DigitalOcean managed DB

(Asked by: username_0 on 2021-11-19)

I just cloned an existing droplet with a working instance of Craft, I created a MySQL8 managed DB but whenever I run php ./craft setup I get this error:
Caused by: Exception 'yii\db\Exception' with message 'SQLSTATE[HY000]: General error: 3161 Storage engine MyISAM is disabled (Table creation is disallowed).
The SQL being executed was: CREATE TABLE `searchindex` (
    `elementId` int(11) NOT NULL,
    `attribute` varchar(25) NOT NULL,
    `fieldId` int(11) NOT NULL,
    `siteId` int(11) NOT NULL,
    `keywords` text NOT NULL
)  ENGINE=MyISAM DEFAULT CHARACTER SET = utf8'

in /srv/gentri/vendor/yiisoft/yii2/db/Schema.php:678

Error Info:
Array
(
    [0] => HY000
    [1] => 3161
    [2] => Storage engine MyISAM is disabled (Table creation is disallowed).
)

Caused by: Exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 3161 Storage engine MyISAM is disabled (Table creation is disallowed).'

I understand that MyISAM is not as widely supported as InnoDB but that searchindex requires it because it is full text searchable. But I'm wondering how I can set Craft up with this restriction?  If I run show engines in the database I can see that the DB is configured the exact same way as another Craft instance which is working perfectly fine.  I'm also wondering why I've never run into this before when working with DigitalOcean's managed dbs.

**Tags:** mysql, deployment, digitalocean

---

## 1 answers

### Answer by username_1 on 2021-11-20. Score: 2 | Accepted answer

If you're trying to install Craft directly onto a MySQL box that has MyISAM disabled, you can either:

Modify Craft's install migration at vendor/craftcms/cms/src/migrations/Install.php

Find this:
// Add the FULLTEXT index on searchindex.keywords
$this->createTable(Table::SEARCHINDEX, [
    'elementId' => $this->integer()->notNull(),
    'attribute' => $this->string(25)->notNull(),
    'fieldId' => $this->integer()->notNull(),
    'siteId' => $this->integer()->notNull(),
    'keywords' => $this->text()->notNull(),
], ' ENGINE=MyISAM');

Change it to this:
// Add the FULLTEXT index on searchindex.keywords
$this->createTable(Table::SEARCHINDEX, [
    'elementId' => $this->integer()->notNull(),
    'attribute' => $this->string(25)->notNull(),
    'fieldId' => $this->integer()->notNull(),
    'siteId' => $this->integer()->notNull(),
    'keywords' => $this->text()->notNull(),
]);

Then do the installation, or:

Do the Craft installation on a local dev environment that supports MyISAM, convert the searchindex table to InnoDB using your favorite MySQL client, then restore that database to the box that doesn't support MyISAM.


---

