這篇文章主要介紹了MySQL 5.5如何設(shè)置配置文件,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
成都創(chuàng)新互聯(lián)專注于文縣網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供文縣營銷型網(wǎng)站建設(shè),文縣網(wǎng)站制作、文縣網(wǎng)頁設(shè)計(jì)、文縣網(wǎng)站官網(wǎng)定制、微信平臺小程序開發(fā)服務(wù),打造文縣網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供文縣網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。在MySQL數(shù)據(jù)庫中,可以沒有配置文件,在這種情況下,MySQL會安裝編譯時的默認(rèn)參數(shù)設(shè)置啟動實(shí)例
用以下命令查看,當(dāng)MYSQL數(shù)據(jù)庫實(shí)例啟動時,它會在哪些位置查找配置文件
[root@localhost test]# mysql --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
MySQL里面有啟動參數(shù)、系統(tǒng)參數(shù),啟動參數(shù)通過show variables無法查詢到,可以在mysqld的選項(xiàng)中查到
例如關(guān)于二進(jìn)制日志有Startup Options Used with Binary Logging、System Variables Used with Binary Logging兩種參數(shù)
[root@localhost log]# mysqld --verbose --help > 02.txt
[root@localhost log]# vim 02.txt
..
--binlog-do-db=name Tells the master it should log updates for the specified
database, and exclude all others not explicitly
mentioned.
..
[root@localhost log]# vim /etc/my.cnf
..
# log
server-id = 10000
log-bin = /log/binlog/mysql-bin
binlog_format = MIXED
binlog-do-db = test
[root@localhost data]# vim /etc/my.cnf
[client]
port = 3306
socket=/mysql_data/70005/mysql.sock
# Mysql server
[mysqld]
port = 3306
user = mysql
socket=/mysql_data/70005/mysql.sock
pid-file = /mysql_data/70005/mysqld.pid
basedir = /software
datadir = /data
#tmpdir =
open_files_limit = 10240
max_connections = 500
max_connect_errors = 100000
sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
wait_timeout = 100
# Cache
table_open_cache = 400
thread_cache_size = 300
# Buffer
max_allowed_packet = 256M
max_heap_table_size = 256M
net_buffer_length = 8K
sort_buffer_size = 4M
join_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
#query_cache_size = 32M
# Log
server-id = 1
log-bin = /log/binlog/mysql-bin
sync_binlog = 2
binlog_cache_size = 32M
max_binlog_cache_size = 512M
max_binlog_size = 512M
binlog_format = MIXED
#binlog_cache_use = 100
#binlog_cache_disk_use = 50
log_output = FILE
log_error = /log/err.log
slow_query_log = 1
slow_query_log_file = /log/slow_query.log
long_query_time = 10
log-short-format = 0
log_slow_admin_statements = 0
log_queries_not_using_indexes = 0
#log_throttle_queries_not_using_indexes = 0
log_slow_slave_statements = 0
general_log = 0
general_log_file = /log/general_query.log
# InnoDB
innodb_data_file_path = ibdata1:12M:autoextend:max:100G
#innodb_data_file_path = /ibdata/ibdata1:12M:autoextend:max:100G
innodb_data_home_dir = /ibdata
innodb_file_per_table = 1
innodb_log_group_home_dir = /log/innodb
#innodb_log_file_size = 256M
#innodb_log_files_in_group = 3
innodb_log_buffer_size = 8M
innodb_buffer_pool_size = 100M
# InnoDB undo __ Mysql 5.6 or higher
#innodb_undo_directory = /log/undo
#innodb_undo_tablespaces = 2
#innodb_undo_logs = 200
innodb_fast_shutdown = 1
innodb_flush_log_at_trx_commit = 1
innodb_buffer_pool_instances = 5
# MyISAM
#skip-external-locking
#key_buffer_size = 128M
#myisam_sort_buffer_size = 64M
# Character set
#character_set_server = gbk
#collation_server = gbk_bin
# Federated storage engine
federated
# Transaction
init_connect='SET autocommit=0'
[mysql]
no-auto-rehash
default-character-set = gbk
[mysqldump]
quick
max_allowed_packet = 16M
[myisamchk]
#key_buffer_size = 256M
#sort_buffer_size = 256M
#read_buffer = 2M
#write_buffer = 2M
[mysqlhotcopy]
#interactive-timeout
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“MySQL 5.5如何設(shè)置配置文件”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!
當(dāng)前文章:MySQL5.5如何設(shè)置配置文件-創(chuàng)新互聯(lián)
文章來源:http://redsoil1982.com.cn/article26/dchijg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)、網(wǎng)站改版、網(wǎng)站排名、網(wǎng)站設(shè)計(jì)、動態(tài)網(wǎng)站、關(guān)鍵詞優(yōu)化
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容