mysql8版本解决修改编码问题

环境 mysql 8.0

        window 10


进入mysql输入showvariableslike'%char%';查看自己的编码,如果是utf-8就不用往下看了

创建my.ini     把my.ini配置文件放到自己的安装目录下(一开始是没有my.ini文件的)


my.ini代码如下  

##代码什么意思我就不解释了,自己去官网查看
[client]

port=3306

default-character-set=utf8

[mysql]

no-beep

default-character-set=utf8

[mysqld]

port=3306

datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data

character_set_server=utf8

collation-server=utf8_general_ci

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="DESKTOP-P5GJ1E6.log"

slow-query-log=1

slow_query_log_file="DESKTOP-P5GJ1E6-slow.log"

long_query_time=10

log-error="DESKTOP-P5GJ1E6.err"

log-bin="DESKTOP-P5GJ1E6-bin"

server-id=1

report_port=3306

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=30M

thread_cache_size=10

myisam_max_sort_file_size=100G

myisam_sort_buffer_size=51M

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_master_info=10000

sync_relay_log=10000

sync_relay_log_info=10000


最后重启服务就OK了

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • https://blog.csdn.net/steven_liwen/article/details/531884...
    SkTj阅读 2,387评论 0 16
  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,725评论 0 3
  • 雨过天晴 天边出现一道 美丽的彩虹 漂亮极了 若无风雨 怎能有晴 若无风雨 怎能有虹 风雨中要想到晴的好 风雨中要...
    平常心七七阅读 358评论 1 8
  • 很好的资料 讲了一堆 rsync 服务器的配置,但是详细讲了一些常用参数的含义,挺不错http://blog.cs...
    jingkeke阅读 442评论 0 1