My.cnf資料庫參數詳解

來源:互聯網
上載者:User

標籤:my.cnf配置詳解

/etc/my.cnf檔案為mysql的設定檔,內容詳解如下:

 [mysqld]   //伺服器端配置

 datadir=/data/mysql   //資料目錄

 socket=/var/lib/mysql/mysql.sock //socket通訊設定  

 user=mysql //使用mysql使用者啟動

 # Disabling symbolic-links is recommended to prevent assorted security risks  

 symbolic-links=0  //是否支援捷徑

 log-bin=mysql-bin  //開啟bin-log日誌

 server-id = 1  //mysql服務ID

 auto_increment_offset=1    //欄位增長

 auto_increment_increment=2 //欄位增長

[mysqld_safe]  //mysql服務安全啟動配置

 log-error=/var/log/mysqld.log  

 pid-file=/var/run/mysqld/mysqld.pid   

 replicate-do-db =jfedu  //允許slave同步哪個庫



註:

basedir      = path          # 使用給定目錄作為根目錄(安裝目錄)。

datadir      = path          # 從給定目錄讀取資料庫檔案。

pid-file     = filename      # 為mysqld程式指定一個存放進程ID的檔案(僅適用於UNIX/Linux系統); 

socket = /tmp/mysql.sock     # 為MySQL客戶程式與伺服器之間的本地通訊指定一個通訊端檔案(Linux下預設是/var/lib/mysql/mysql.sock檔案)


My.cnf資料庫參數詳解

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.