mysql默认引擎变化_将mysql默认引擎更改为innodb

bd96500e110b49cbb3cd949968f18be7.png

I am using mac and I installed mysql using homebrew.

brew install mysql

pretty standard installation.

mysql> show engines;

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

| Engine | Support | Comment | Transactions | XA | Savepoints |

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

| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |

| CSV | YES | CSV storage engine | NO | NO | NO |

| MyISAM | DEFAULT | Default engine as of MySQL 3.23 with great performance | NO | NO | NO |

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

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

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

I would like innodb to be the default storage engine. What do I need to do?

解决方案

Under [mysqld] section in your ini file, add:

default-storage-engine = innodb

It is usually /etc/my.cnf, but not sure about Mac.

From the docs:

On Unix, Linux and Mac OS X, MySQL programs read startup options from the following files, in the specified order (top items are used first).

File Name Purpose

/etc/my.cnf Global options

/etc/mysql/my.cnf Global options (as of MySQL 5.1.15)

SYSCONFDIR/my.cnf Global options

$MYSQL_HOME/my.cnf Server-specific options

defaults-extra-file The file specified with --defaults-extra-file=path, if any

~/.my.cnf User-specific options

The last one is never used by the daemon.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值