|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
MySQL配置文件(重要参数)
在my.ini文件中,我们可以设置各种MySQL的配置,例如字符集、端口号、目录地址等等
my.ini [client]...[mysql].... 客户端配置信息
[mysqld]... 数据库配置信息
使用notepad++ 或者vs code打开,变色工具,方便阅读配置文件
删除注释之后的my.ini配置文件:(共计54行)原文336行
[client]
port=3306
[mysql]
no-beep #错误时不发生蜂鸣器的声音
[mysqld]
port=3306 #端口号
datadir=C:/ProgramData/MySQL/MySQL Server 8.0\Data #数据目录,迁移数据存储目录,将Data这个文件夹拷贝至新位置,修改路径重启MySQl服务
default_authentication_plugin=caching_sha2_password #密码认证插件,传统密码认证插件
default-storage-engine=INNODB #默认存储引擎,该引擎支持事务,事务才能保存重要数据,一致性等
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION" #开启严格模式,相对于松散模式,就是你在字符串格式中存入了数字,会自动转变为字符,但严格模式,直接会抛出错误
log-output=FILE #用文件记录日志
general-log=0 #关闭日志输出
general_log_file="IT02.log" #日志文件名称
slow-query-log=1 #开启慢查询日志
slow_query_log_file="IT02-slow.log" #慢查询日志文件名称
long_query_time=10 #大于多少秒的执行SQL被记录在慢查询日志
log-error="IT02.err" #错误日志名称
server-id=1 #数据库ID,用于集群时,区别数据库服务器,为整数,集群中唯一标识
lower_case_table_names=1 #把表名转换成小写,大写也会存为小写
secure-file-priv="C:/ProgramData/MySQL/MySQL Server 8.0/Uploads" #导入导出数据的目录地址,数据导入导出文件存放的地址;
max_connections=151 #最大连接数
table_open_cache=2000
tmp_table_size=61M
thread_cache_size=10 #线程数量,台式机保持,如果是服务器修改大一些,主要看硬件大小;
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=113M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=8M
innodb_log_file_size=48M
innodb_thread_concurrency=9
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100
open_files_limit=4161
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_relay_log=10000
sync_relay_log_info=10000
loose_mysqlx_port=33060 |
|