[mysql-Ver5.6.23] windows版my.ini配置
基于utf8mb4比utf8多了种编码,能更好的支持emoji表情(http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html),所以我想让自己的mysql服务器默认使用utf8mb4编码。
于是就得到了配置文件 D:\db\MySQL\Data5.6\my.ini(并不是D:\db\MySQL\Server5.6\my-default.ini)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | [client] no -beep port=3306 [mysql] [mysqld] port=3306 datadir=D:/db/MySQL/Data5.6/Data character - set -client-handshake = FALSE character - set -server=utf8mb4 collation-server = utf8mb4_general_ci init_connect= 'set names utf8mb4' default -storage-engine=INNODB sql-mode= "STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" log- output =FILE general-log=0 general_log_file= "TIANXIAOKU.log" slow-query-log=1 slow_query_log_file= "TIANXIAOKU-slow.log" long_query_time=10 log-error= "TIANXIAOKU.err" server-id=1 max_connections=151 query_cache_size=0 table_open_cache=2000 tmp_table_size=48M thread_cache_size=10 myisam_max_sort_file_size=100G myisam_sort_buffer_size=87M key_buffer_size=8M read_buffer_size=64K read_rnd_buffer_size=256K sort_buffer_size=256K innodb_additional_mem_pool_size=7M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=4M innodb_buffer_pool_size=280M innodb_log_file_size=48M innodb_thread_concurrency=17 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 query_cache_type=0 sort_buffer_size=256K table_definition_cache=1400 binlog_row_event_max_size=8K sync_master_info=10000 sync_relay_log=10000 sync_relay_log_info=10000 |
其中最主要的是以下几句:
character-set-client-handshake = FALSE # 设置客户端使用服务端配置的编码,忽略客户端编码的配置
character-set-server=utf8mb4 # 设置服务端编码
collation-server = utf8mb4_general_ci # 设置服务端排序规则
init_connect='set names utf8mb4'
还有个需要注意的就是:
1. default-storage-engine=INNODB 默认的数据存储引擎
2. sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 规则越严格,意味着操作时受到的限制越多!
----------------------------------------------------------------------
再贡献一个windows上的phpstudy中mysql下的my.ini(D:\soft\phpStudy\MySQL\my.ini)配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | # power by phpStudy 2014 www.phpStudy.net 官网下载最新版 [client] port=3306 [mysql] [mysqld] port=3306 basedir= "D:/soft/phpStudy/MySQL/" datadir= "D:/soft/phpStudy/MySQL/data/" character - set -client-handshake= FALSE character - set -server=utf8mb4 collation-server=utf8mb4_general_ci default -storage-engine=InnoDB init_connect= 'set names utf8mb4' sql-mode= "NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" max_connections=512 query_cache_size=0 table_cache=256 tmp_table_size=18M thread_cache_size=8 myisam_max_sort_file_size=64G myisam_sort_buffer_size=35M key_buffer_size=25M read_buffer_size=64K read_rnd_buffer_size=256K sort_buffer_size=256K innodb_additional_mem_pool_size=2M innodb_flush_log_at_trx_commit=1 innodb_log_buffer_size=1M innodb_buffer_pool_size=47M innodb_log_file_size=24M innodb_thread_concurrency=8 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET10 - 预览版1新功能体验(一)
2010-11-18 _kbhit----Checks the console for keyboard input