How can I set default storage engine used by MySQL?

后端 未结 2 475
陌清茗
陌清茗 2020-12-23 19:33

I\'ve been working on writing SQL to create a MySQL database with several default options, including character set and collation. Is it possible to set the default storage

相关标签:
2条回答
  • 2020-12-23 19:45

    you need to specify the default storage engine when starting mysqld. for example:

    mysqld --default-storage-engine=InnoDB
    

    http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_default-storage-engine

    0 讨论(0)
  • 2020-12-23 20:04

    Quoting the Reference Manual (Setting the Storage Engine):

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

    The default-storage-engine option must be part of the mysqld section in my.cnf;

    [mysqld]
    default-storage-engine = innodb
    

    You may also want to change the default storage engine just for the current session. You can do this by setting the storage_engine variable:

    SET storage_engine=INNODB;
    
    0 讨论(0)
提交回复
热议问题