老熟女激烈的高潮_日韩一级黄色录像_亚洲1区2区3区视频_精品少妇一区二区三区在线播放_国产欧美日产久久_午夜福利精品导航凹凸

重慶分公司,新征程啟航

為企業提供網站建設、域名注冊、服務器等服務

Ubuntu中MySQL的參數文件my.cnf有什么用-創新互聯

這篇文章主要介紹Ubuntu中MySQL的參數文件my.cnf有什么用,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!

讓客戶滿意是我們工作的目標,不斷超越客戶的期望值來自于我們對這個行業的熱愛。我們立志把好的技術通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領域值得信任、有價值的長期合作伙伴,公司提供的服務項目有:空間域名、網站空間、營銷軟件、網站建設、長海網站維護、網站推廣。

前言

對于MySQL的理解,我認為很多性能優化工作、主從主主復制都是在調整參數,來適應不同時期不同數量級的數據。

故,理解透徹my.cnf里的參數是永恒的話題;只有理解透徹了參數設置,才能在某些方面對數據庫進行調優。

前幾天剛接手一個MySQL數據,操作系統為Ubuntu 16.04.5 LTS,  數據庫版本為5.7.23-0ubuntu0.16.04.1(APT方式安裝的MySQL)。這個操作系統下的MySQL的配置文件my.cnf很多地方都讓人有點不適應(跟之前的MySQL環境有些出入,之前都是維護RHEL、CentOS等操作系統環境下的MySQL)。

遂研究總結了一下。具體如下所示:

root@mylnx12:~# find / -name "my.cnf"
/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/var/lib/dpkg/alternatives/my.cnf
root@mylnx12:~# locate my.cnf
/etc/alternatives/my.cnf
/etc/mysql/my.cnf
/etc/mysql/my.cnf.fallback
/var/lib/dpkg/alternatives/my.cnf
root@mylnx12:~# mysql --help | grep my.cnf
      order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 
root@mylnx12:~# mysqld --verbose --help | grep -A 1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

從上面這些信息判斷,MySQL的參數文件為/etc/mysql/my.cnf, 但是其他幾個my.cnf又是什么情況呢?

root@mylnx12:~# ls -lrt /etc/alternatives/my.cnf
lrwxrwxrwx 1 root root 20 Sep 28 16:28 /etc/alternatives/my.cnf -> /etc/mysql/mysql.cnf

從上面信息可以看出,/etc/alternatives/my.cnf 其實是一個軟連接,指向參數文件/etc/mysql/mysql.cnf

root@mylnx12:~# cat /var/lib/dpkg/alternatives/my.cnf
auto
/etc/mysql/my.cnf
 
/etc/mysql/my.cnf.fallback
100
/etc/mysql/mysql.cnf
200

光從上面這些信息,我們還看不出/var/lib/dpkg/alternatives/my.cnf與其它配置文件my.cnf是什么關系。那么我們先來看看參數文件/etc/mysql/my.cnf,從下面信息,可以看出“/etc/mysql/my.cnf”是全局配置,“~/.my.cnf”隱藏文件是個人用戶設置.

root@mylnx12:~# cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
 
#
# * IMPORTANT: Additional settings that can override those from this file!
#  The files must end with '.cnf', otherwise they'll be ignored.
#
 
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

但是/etc/mysql/my.cnf參數文件下面沒有任何參數設置,只看到下面兩行設置,表示導入這兩個目錄里面的配置文件。

!includedir /etc/mysql/conf.d/    

#表示包含/etc/mysql/conf.d/這個路徑下面的配置文件,前提是必須以為.cnf為后綴

!includedir /etc/mysql/mysql.conf.d/

#表示包含/etc/mysql/mysql.conf.d/這個路徑下面的配置文件,前提是必須以為.cnf為后綴

其實MySQL的相關配置都位于mysqld.cnf(/etc/mysql/mysql.conf.d/mysqld.cnf)下面。使用相關參數測試了一下,確實都能生效。這種設置確實有點讓剛接觸的人有點不適應。暫時先總結到此!

root@mylnx12:~# cd /etc/mysql/mysql.conf.d/
root@mylnx12:/etc/mysql/mysql.conf.d# ls -lrt
total 8
-rw-r--r-- 1 root root  21 Feb 4 2017 mysqld_safe_syslog.cnf
-rw-r--r-- 1 root root 3148 Oct 6 23:34 mysqld.cnf
root@mylnx12:/etc/mysql/mysql.conf.d# cat mysqld.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
 
# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
 
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
 
[mysqld_safe]
socket     = /var/run/mysqld/mysqld.sock
nice      = 0
 
[mysqld]
#
# * Basic Settings
#
user      = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket     = /var/run/mysqld/mysqld.sock
port      = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir     = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
log_bin    = mylnx12_bin
server_id   = 0
character-set-server=utf8mb4
collation-server=utf8mb4_general_ci
 
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address      = 10.21.6.7
#
# * Fine Tuning
#
key_buffer_size     = 16M
max_allowed_packet   = 100M
thread_stack      = 192K
thread_cache_size    = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP
#max_connections    = 100
#table_cache      = 64
#thread_concurrency   = 10
#
# * Query Cache Configuration
#
query_cache_limit    = 1M
query_cache_size    = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file    = /var/log/mysql/mysql.log
#general_log       = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#log_slow_queries    = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#    other settings you may need to change.
#server-id       = 1
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size  = 100M
#binlog_do_db      = include_database_name
#binlog_ignore_db    = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
#: ssl-key=/etc/mysql/server-key.pem

以上是“Ubuntu中MySQL的參數文件my.cnf有什么用”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注創新互聯成都網站設計公司行業資訊頻道!

另外有需要云服務器可以了解下創新互聯scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業上云的綜合解決方案,具有“安全穩定、簡單易用、服務可用性高、性價比高”等特點與優勢,專為企業上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。


分享標題:Ubuntu中MySQL的參數文件my.cnf有什么用-創新互聯
瀏覽路徑:http://www.xueling.net.cn/article/csipjc.html

其他資訊

在線咨詢
服務熱線
服務熱線:028-86922220
TOP
主站蜘蛛池模板: 亚洲一区二区三区四区五区不卡 | 少妇被躁爽到高潮无码麻豆AV | yourporn久久久亚洲精品 | 亚洲色大成网站WWW永久在线观看 | 亚洲国产精品视频一区二区 | 欧美大色视频在线观看 | 91精产国品一二三区 | 国产精品精品视频 | 日韩精品第1页 | 久久精品无码一区二区WWW | 亚洲一本之道高清在线观看 | 亚洲xxx视频| 中文字幕 | 国产午夜免费高清久久影院 | 美女久久久久久久久 | 亚洲欧洲国产精品一区 | 精品成人佐山爱一区二区 | 性欧美一级 | 亚洲福利中文字幕 | 国产一级二级毛片 | av中文字幕在线观看 | 亚洲精品无码久久久久久久久久久久久 | 国产小视频在线观看网站 | 日本A级毛片无卡免费视频 99热这里只有精品4 | 中文字幕久久波多野结衣AV | 0855午夜福利 | 少妇自慰浓密的p毛 | 一级做a爰性色毛片免费视频 | 亚洲精品国产精品国自 | 阿娇囗交全套码在线观看 | 在线免费中文字日产 | 久久亚洲精品情侣 | 亚洲精品乱码久久久久久久久久久久 | 日本一区二区国产 | 午夜免费视频 | 日韩精品无码久久久久久 | 久久99精品久久久久婷婷暖 | 好爽啊中文字幕一区二区久久 | 青青一区二区三区 | 国产一区二区美女 | 久久免费精品国自产拍网站 |