Mac Os - Como trocar o storage engine de InnoDB para MyISAM
Autor: Edipo G | Publicado: 2013-09-21T13:36:00-03:00


Tive que ralar um pouco para saber exatamente como trocar o storage engine do mysql de InnoDB para MyISAM. As alteração foram feitas no Mac OS Mavericks.<!--
google_ad_client = "ca-pub-3021803715878426";
/* lordpinguimPost */
google_ad_slot = "9468077813";
google_ad_width = 300;
google_ad_height = 250;
//

--&gt;




Abaixo os passos:



Abra um terminal e digite:



sudo vi /usr/local/mysql/my.cnf



abaixo da palavra &nbsp;[mysqld]&nbsp;coloque a seguinte linha, aperte antes i para entrar no modo de edição do vim:




default-storage-engine=myisam




Depois aperte a tecla ESC, digite :wq e aperte enter, arquivo salvo, vá até o painel de controle do Mac OS, pare o Mysql e inicie novamente, agora o engine padrão é o MyISAM.



Para confirmar digite no terminal:




mysql -u root -p


Digite sua senha de root do mysql, dentro do prompt dele digite:




mysql&gt; show engines;




Vai aparecer assim:




mysql&gt; show engines;

ERROR 2006 (HY000): MySQL server has gone away

No connection. Trying to reconnect...

Connection id:&nbsp; &nbsp; 6

Current database: *** NONE ***



+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| Engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Support | Comment&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Transactions | XA &nbsp; | Savepoints |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| FEDERATED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO&nbsp; &nbsp; &nbsp; | Federated MySQL storage engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NULL &nbsp; &nbsp; &nbsp; &nbsp; | NULL | NULL &nbsp; &nbsp; &nbsp; |

| MRG_MYISAM &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Collection of identical MyISAM tables&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| MyISAM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | DEFAULT | MyISAM storage engine&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| BLACKHOLE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | /dev/null storage engine (anything you write to it disappears) | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| CSV&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | CSV storage engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| MEMORY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Hash based, stored in memory, useful for temporary tables&nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| ARCHIVE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Archive storage engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| InnoDB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Supports transactions, row-level locking, and foreign keys &nbsp; &nbsp; | YES&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES&nbsp; | YES&nbsp; &nbsp; &nbsp; &nbsp; |

| PERFORMANCE_SCHEMA | YES &nbsp; &nbsp; | Performance Schema &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

9 rows in set (0,01 sec)








Veja que agora o MyISAm esta como default, antes da modificação estava assim:






mysql&gt; show engines;

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| Engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Support | Comment&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | Transactions | XA &nbsp; | Savepoints |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| FEDERATED&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO&nbsp; &nbsp; &nbsp; | Federated MySQL storage engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NULL &nbsp; &nbsp; &nbsp; &nbsp; | NULL | NULL &nbsp; &nbsp; &nbsp; |

| MRG_MYISAM &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Collection of identical MyISAM tables&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| MyISAM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | MyISAM storage engine&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| BLACKHOLE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | /dev/null storage engine (anything you write to it disappears) | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| CSV&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | CSV storage engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| MEMORY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Hash based, stored in memory, useful for temporary tables&nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| ARCHIVE&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES &nbsp; &nbsp; | Archive storage engine &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

| InnoDB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | DEFAULT | Supports transactions, row-level locking, and foreign keys &nbsp; &nbsp; | YES&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | YES&nbsp; | YES&nbsp; &nbsp; &nbsp; &nbsp; |

| PERFORMANCE_SCHEMA | YES &nbsp; &nbsp; | Performance Schema &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | NO &nbsp; | NO &nbsp; &nbsp; &nbsp; &nbsp; |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

9 rows in set (0,03 sec)








Esper ter ajudado.