MySQL資料庫配置檔案

2021-09-01 02:41:20 字數 1228 閱讀 3555

cat /etc/my.cnf

[mysqld]

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data

user=mysql

port = 3306

socket = /usr/local/mysql/tmp/mysql.sock

#伺服器字符集

character-set-server=utf8

#0-大小寫敏感,1-大小寫不敏感,預設0

lower_case_table_names=1

#最大連線數,預設100

max_connections=1000

#group_concat長度設為最大值,預設1024

group_concat_max_len = -1

#是否信任函式建立者,預設0

log_bin_trust_function_creators=1

sql_mode=no_engine_substitution,strict_trans_tables

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

#支援符合鏈結,分割槽儲存,預設1

#symbolic-links=0

#跳過網域名稱反解析

skip-name-resolve

#innodb緩衝池配置

# 這個值設為1時,將會在每次日誌提交時,將日誌緩衝(log buffer)中的內容刷入硬碟,以確保資料最大限度的完整性,當然這樣也會對效能帶來影響。如果設為2,表示每次日誌提交時,僅僅將日誌緩衝中的內容刷入作業系統的檔案快取。

innodb_flush_log_at_trx_commit=2

#日誌快取大小

innodb_log_buffer_size=1024m

#日誌檔案大小

innodb_log_file_size=1024m

#緩衝池大小

innodb_buffer_pool_size = 30720m

[client]

default-character-set=utf8

[mysqld_safe]

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

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

discuz資料庫配置檔案

系統需要修改的位置有兩處 discuz 和 uc center 路徑 wwwroot config config global.php 這個根據你 安裝的路徑而定。開啟 config global.php 檔案修改 config db 1 dbpw 原來密碼 原來密碼 修改為新的資料庫密碼。路徑 w...

PHP讀取配置檔案連線MySQL資料庫

讀取配置檔案方法parse ini file filepath section conn.php 連線資料庫 conn new mysqli localhost root test or die 連線失敗 讀取配置檔案 ini parse ini file test.ini conn new mys...

Spring配置檔案中資料庫配置

classpath init.properties propagation required propagation required propagation required propagation required propagation required propagation require...