mac的msql字符集修改,却没找着文件
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了mac的msql字符集修改,却没找着文件,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2375字,纯文字阅读大概需要4分钟。
内容图文
可能你在django会遇到连接数据库时,会不断报错,提醒你安装mysqlclient(事实上你早已安装了),这都是字符集不匹配惹的祸。
1.寻找配置文件
你一开始可能从找配置文件就出了毛病,大家都是在这里:/usr/local/mysql/support-files/
找到my-default.cnf,可你愣是没有。。。
这里八成是安装方式埋下的坑,比如佳酿安装的mysql。自动直接就执行了:
sudo cp /usr/local/mysql/support-files/my-default.cnf /usr/local/etc/my.cnf
这里注意my.cnf不在/etc下??,在佳酿自己的etc下,所以千万要注意自己的下载方式(下面继续以佳酿为例)
2.修改my.cnf
vim my.cnf
没错,就是这么干净。。
所以想要修改的话,你需要自己搬运一下了。
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it‘s important that the mysqld daemon
# doesn‘t use much resources.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
default-character-set=utf8
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
default-storage-engine=INNODB
character-set-server=utf8
collation-server=utf8_general_ci
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K
# Don‘t listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
# binary logging format - mixed recommended
#binlog_format=mixed
# Causes updates to non-transactional engines using statement format to be
# wri
到这里你就可以参照其他博主和自己要求来改了。
推荐:https://www.cnblogs.com/jie-fang/p/10214207.html
原文:https://www.cnblogs.com/cheflone/p/13557241.html
内容总结
以上是互联网集市为您收集整理的mac的msql字符集修改,却没找着文件全部内容,希望文章能够帮你解决mac的msql字符集修改,却没找着文件所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。