mac osx 10.9
mysql 5.5
安装mysql的dmg文件后,将/usr/local/mysql/support-files中的任意一个.cnf文件copy到/etc/目录并重命名为my.cnf
修改my.cnf
找到[mysqld] 添加
character-set-server=utf8chatracter-set-server=utf8
init_connect='SET NAMES utf8'
找到[mysql]
default-character-set=utf8
然后重启mysql服务。
注:如果在mysqld中添加的是default-character-set=utf8,则会导致mysql无法启动
-
#ExampleMySQLconfigfileformediumsystems.
-
#
-
#Thisisforasystemwithlittlememory(32M-64M)whereMySQLplays
-
#animportantpart,orsystemsupto128MwhereMySQLisusedtogetherwith
-
#otherprograms(suchasawebserver)
-
#
-
#MySQLprogramslookforoptionfilesinasetof
-
#locationswhichdependonthedeploymentplatform.
-
#Youcancopythisoptionfiletooneofthose
-
#locations.Forinformationabouttheselocations,see:
-
#http://dev.mysql.com/doc/mysql/en/option-files.html
-
#
-
#Inthisfile,youcanusealllongoptionsthataprogramsupports.
-
#Ifyouwanttoknowwhichoptionsaprogramsupports,runtheprogram
-
#withthe"--help"option.
-
-
#ThefollowingoptionswillbepassedtoallMySQLclients
-
[client]
-
#password=your_password
-
port=3306
-
socket=/tmp/mysql.sock
-
-
#Herefollowsentriesforsomespecificprograms
-
-
#TheMySQLserver
-
[mysqld]
-
port=3306
-
socket=/tmp/mysql.sock
-
skip-external-locking
-
key_buffer_size=16M
-
max_allowed_packet=1M
-
table_open_cache=64
-
sort_buffer_size=512K
-
net_buffer_length=8K
-
read_buffer_size=256K
-
read_rnd_buffer_size=512K
-
myisam_sort_buffer_size=8M
-
character-set-server=utf8
-
init_connect='SETNAMESutf8'
-
-
#Don'tlistenonaTCP/IPportatall.Thiscanbeasecurityenhancement,
-
#ifallprocessesthatneedtoconnecttomysqldrunonthesamehost.
-
#AllinteractionwithmysqldmustbemadeviaUnixsocketsornamedpipes.
-
#NotethatusingthisoptionwithoutenablingnamedpipesonWindows
-
#(viathe"enable-named-pipe"option)willrendermysqlduseless!
-
#
-
#skip-networking
-
-
#ReplicationMasterServer(default)
-
#binaryloggingisrequiredforreplication
-
log-bin=mysql-bin
-
-
#binaryloggingformat-mixedrecommended
-
binlog_format=mixed
-
-
#requireduniqueidbetween1and2^32-1
-
#defaultsto1ifmaster-hostisnotset
-
#butwillnotfunctionasamasterifomitted
-
server-id=1
-
-
#ReplicationSlave(commentoutmastersectiontousethis)
-
#
-
#Toconfigurethishostasareplicationslave,youcanchoosebetween
-
#twomethods:
-
#
-
#1)UsetheCHANGEMASTERTOcommand(fullydescribedinourmanual)-
-
#thesyntaxis:
-
#
-
#CHANGEMASTERTOMASTER_HOST=<host>,MASTER_PORT=<port>,
-
#MASTER_USER=<user>,MASTER_PASSWORD=<password>;
-
#
-
#whereyoureplace<host>,<user>,<password>byquotedstringsand
-
#<port>bythemaster'sportnumber(3306bydefault).
-
#
-
#Example:
-
#
-
#CHANGEMASTERTOMASTER_HOST='125.564.12.1',MASTER_PORT=3306,
-
#MASTER_USER='joe',MASTER_PASSWORD='secret';
-
#
-
#OR
-
#
-
#2)Setthevariablesbelow.However,incaseyouchoosethismethod,then
-
#startreplicationforthefirsttime(evenunsuccessfully,forexample
-
#ifyoumistypedthepasswordinmaster-passwordandtheslavefailsto
-
#connect),theslavewillcreateamaster.infofile,andanylater
-
#changeinthisfiletothevariables'valuesbelowwillbeignoredand
-
#overriddenbythecontentofthemaster.infofile,unlessyoushutdown
-
#theslaveserver,deletemaster.infoandrestarttheslaverserver.
-
#Forthatreason,youmaywanttoleavethelinesbelowuntouched
-
#(commented)andinsteaduseCHANGEMASTERTO(seeabove)
-
#
-
#requireduniqueidbetween2and2^32-1
-
#(anddifferentfromthemaster)
-
#defaultsto2ifmaster-hostisset
-
#butwillnotfunctionasaslaveifomitted
-
#server-id=2
-
#
-
#Thereplicationmasterforthisslave-required
-
#master-host=<hostname>
-
#
-
#Theusernametheslavewilluseforauthenticationwhenconnecting
-
#tothemaster-required
-
#master-user=<username>
-
#
-
#Thepasswordtheslavewillauthenticatewithwhenconnectingto
-
#themaster-required
-
#master-password=<password>
-
#
-
#Theportthemasterislisteningon.
-
#optional-defaultsto3306
-
#master-port=<port>
-
#
-
#binarylogging-notrequiredforslaves,butrecommended
-
#log-bin=mysql-bin
-
-
#UncommentthefollowingifyouareusingInnoDBtables
-
#innodb_data_home_dir=/usr/local/mysql/data
-
#innodb_data_file_path=ibdata1:10M:autoextend
-
#innodb_log_group_home_dir=/usr/local/mysql/data
-
#Youcanset.._buffer_pool_sizeupto50-80%
-
#ofRAMbutbewareofsettingmemoryusagetoohigh
-
#innodb_buffer_pool_size=16M
-
#innodb_additional_mem_pool_size=2M
-
#Set.._log_file_sizeto25%ofbufferpoolsize
-
#innodb_log_file_size=5M
-
#innodb_log_buffer_size=8M
-
#innodb_flush_log_at_trx_commit=1
-
#innodb_lock_wait_timeout=50
-
-
[mysqldump]
-
quick
-
max_allowed_packet=16M
-
-
[mysql]
-
no-auto-rehash
-
#RemovethenextcommentcharacterifyouarenotfamiliarwithSQL
-
#safe-updates
-
default-character-set=utf8
-
-
[myisamchk]
-
key_buffer_size=20M
-
sort_buffer_size=20M
-
read_buffer=2M
-
write_buffer=2M
-
-
[mysqlhotcopy]
-
interactive-timeout
-
分享到:
相关推荐
mac OSX 系统 MySQL中文乱码解决办法
主要介绍了Mac Mysql数据库中文乱码问题解决的相关资料,需要的朋友可以参考下
先说明一下自己的环境:Mac OS X 10.8.3,MySQL Community Server 5.6.10,MySQL Workbench 5.2.47。 我想把本机数据库内的数据迁移到另一台机器上,于是使用Workbench中自带的import/export功能,其实是调用...
先说明一下自己的环境:Mac OS X 10.8.3, MySQL Community Server 5.6.10, MySQL Workbench 5.2.47。 我想把本机数据库内的数据迁移到另一台机器上,于是使用Workbench中自带的import/export功能,其实就是调用...
Navicat 自己到处的数据,...在用Navicat导出时用的是UTF8编码,导入时MySQL用自己默认的编码方式导入,中文产生了乱码 用命令查询 mysql>show variables like '%char%'; 查询看到编码是gbk 然后查到的全部用 mys
本文主要介绍了如何修改MAC版mysql默认字符集为utf8,如果你的MAC版mysql字符乱码,可以参考一下
mysql5.7.23 for mac os x10.13+ & navicat.zi及密码修改、设置、启动及常见问题整理
本工具用于mac os 系统的mysql工具。简便轻巧。
软件简介:RazorSQL 是数据库查询工具、SQL的编辑、数据库管理工具,可以通过ODBC,JDBC连接数据库,已经证实可以使用的数据库种类,达到了29种. RazorSQL is an SQL query tool, database browser, SQL ...
5. Mac OS X 系统下的安装 6. Windows 系统下的安装 7. PECL 扩展库安装 8. 还有问题? 9. 运行时配置 III. 语言参考 10. 基本语法 11. 类型 12. 变量 13. 常量 14. 表达式 15. 运算符 16. 流程控制 17...
SsHome_Ver2.0技术网站链接Bootstrap4 Spring文献 GitHub OAuth 2.0 OKHttp api-getUsers-demo新版本mysql修改root密码时提示语法错误的解决方法彻底解决mysql中文乱码 Json在线编辑器 Markdown编辑器项目部署说明 1...
ShopNC综合多用户商城系统是一个面向大型电子商务平台架设的解决方案。系统采用PHP MySQL构建,运营者可以轻松的在网络中构建一个商城交易平台,提供自由开店、在线交易、供求信息等多种服务。 可以广泛应用在综合...
● 修复vlog_list分表时在Mysql5.7+下的sql错误;● 修复文件附件浏览,删除附件时url报错;● 修复等宽截取字符乱码问题;● 修复添加自定义字段时,字段扩展控件不能选择问题;● 修复地图: ->选择地图标点时...
采用UTF-8编码,内建多语版本,可自行添加任意语言,有效避免浏览器乱码问题; 高性能: 采用Zend Optimizer做最佳化处理,数据库优化、页面缓存,性能优越,为服务器减压提高性能,支持大流量网站; 高安全:...