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.

1

3 Answers 3

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

Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

Latest versions have default_storage_engine variable
-1

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

Database creation

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.