16


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.

Can anyone help me out? Thanks.

vkGunasekaran
  • 6,668
  • 7
  • 50
  • 59

3 Answers3

13

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

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

shankhan
  • 6,343
  • 2
  • 19
  • 22
12

Check the syntax for 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

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

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”.

Dizzley
  • 487
  • 6
  • 16
-1

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

Database creation

Harish
  • 2,311
  • 4
  • 23
  • 28