更改mysql的缺省數(shù)據(jù)庫(kù)引擎表的方法
一般安裝系統(tǒng)默認(rèn)是INNODB
default-storage-engine=INNODB
其他有
#*** INNODB Specific options ***
# Use this option if you have a MySQL server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
-
# and speed up some things.
#skip-innodb
# Additional memory pool that is used by InnoDB to store metadata
# information. If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS. As this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size=2M
# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=1
# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size=1M
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size=8M
# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=10M
# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency=8
將他改為myisam
使用一個(gè)指定的存儲(chǔ)引擎
你可以使用很多方法指定一個(gè)要使用的存儲(chǔ)引擎。最簡(jiǎn)單的方法是,如果你喜歡一種能滿(mǎn)足你的大多數(shù)數(shù)據(jù)庫(kù)需求的存儲(chǔ)引擎,你可以在MySQL設(shè)置文件中設(shè)置一個(gè)默認(rèn)的引擎類(lèi)型(使用storage_engine 選項(xiàng))或者在啟動(dòng)數(shù)據(jù)庫(kù)服務(wù)器時(shí)在命令行后面加上--default-storage-engine或--default-table-type選項(xiàng) 。
更靈活的方式是在隨MySQL服務(wù)器發(fā)布同時(shí)提供的MySQL客戶(hù)端時(shí)指定使用的存儲(chǔ)引擎。最直接的方式是在創(chuàng)建表時(shí)指定存儲(chǔ)引擎的類(lèi)型,向下面這樣:
CREATE TABLE mytable (id int, title char(20)) ENGINE = INNODB 本文出自:億恩科技【www.riomediacenter.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|