MySQL 在mysql中创建innodb数据库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4755854/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 18:24:30  来源:igfitidea点击:

Create innodb database in mysql

mysqldatabaseinnodb

提问by vkGunasekaran


I tried to create a database type of innodb.I tried this query but its not exectuted.

CREATE DATABASE "mydd" ENGINE = InnoDB

I checked the configuration and it says innodb enabled. I also searched in web but only ended up
with creatin innodb tables.

I set the database as innodb then all the table under this will takes the same type and no need to specify again.Also my defauld engine should not be innodb.


我试图创建一个 innodb 的数据库类型。我尝试了这个查询,但它没有执行。

CREATE DATABASE "mydd" ENGINE = InnoDB

我检查了配置,它说启用了 innodb。我也在网上搜索过,但最终只得到了
creatin innodb 表。

我将数据库设置为innodb,那么这个下的所​​有表都将采用相同的类型,无需再次指定。另外,我的默认引擎不应该是innodb。

Can anyone help me out? Thanks.

谁能帮我吗?谢谢。

采纳答案by shankhan

I don't think you can specify Engine while creating database.

我认为您不能在创建数据库时指定 Engine 。

because one database can have multiple engine type tables in it

因为一个数据库中可以有多个引擎类型表

Check create database command at http://dev.mysql.com/doc/refman/5.5/en/create-database.html

http://dev.mysql.com/doc/refman/5.5/en/create-database.html检查创建数据库命令

回答by Dizzley

Check the syntax for CREATE DATABASE: http://dev.mysql.com/doc/refman/5.0/en/create-database.html

检查 CREATE DATABASE 的语法:http: //dev.mysql.com/doc/refman/5.0/en/create-database.html

CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name [create_specification] ...

create_specification: [DEFAULT] CHARACTER SET [=] charset_name | [DEFAULT] COLLATE [=] collation_name

创建{数据库 | SCHEMA} [如果不存在] db_name [create_specification] ...

create_specification: [DEFAULT] CHARACTER SET [=] charset_name | [DEFAULT] COLLATE [=] collat​​ion_name

You can change the default storage engine on starting up mysql, or during your session. See http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html

您可以在启动 mysql 时或在会话期间更改默认存储引擎。见http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html

If you omit the ENGINE or TYPE option, the default storage engine is used. Normally, this is MyISAM, but you can change it by using the --default-storage-engine or --default-table-type server startup option, or by setting the default-storage-engine or default-table-type option in the my.cnf configuration file.

You can set the default storage engine to be used during the current session by setting the storage_engine or table_type variable:

SET storage_engine=MYISAM; SET table_type=BDB;

When MySQL is installed on Windows using the MySQL Configuration Wizard, the InnoDB or MyISAM storage engine can be selected as the default. See Section 2.10.3.5, “The Database Usage Dialog”.

如果省略 ENGINE 或 TYPE 选项,则使用默认存储引擎。通常,这是 MyISAM,但您可以通过使用 --default-storage-engine 或 --default-table-type 服务器启动选项,或通过设置 default-storage-engine 或 default-table-type 选项来更改它my.cnf 配置文件。

您可以通过设置 storage_engine 或 table_type 变量来设置要在当前会话期间使用的默认存储引擎:

SET storage_engine=MYISAM; SET table_type=BDB;

当使用 MySQL 配置向导在 Windows 上安装 MySQL 时,可以选择 InnoDB 或 MyISAM 存储引擎作为默认值。请参见第 2.10.3.5 节,“数据库使用对话框”。

回答by Harish

Hi normally programmers use innodb for table don't know if you can set it for database refer

嗨通常程序员使用innodb作为表不知道你是否可以将它设置为数据库引用

Database creation

数据库创建