将mysql默认引擎更改为innodb [英] change mysql default engine to innodb

查看:73
本文介绍了将mysql默认引擎更改为innodb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Mac,并且使用自制软件安装了mysql.

I am using mac and I installed mysql using homebrew.

brew install mysql

漂亮的标准安装.

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         |
+------------+---------+------------------------------------------------------------+--------------+------+------------+

我希望innodb成为默认的存储引擎.我该怎么办?

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

推荐答案

在ini文件的[mysqld]部分下,添加:

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

default-storage-engine = innodb

通常为/etc/my.cnf,但不确定Mac.

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

文档:

在Unix,Linux和Mac OS X上,MySQL程序以指定的顺序从以下文件中读取启动选项(首先使用顶部的项).

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.

这篇关于将mysql默认引擎更改为innodb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆