使用Mac的小伙伴在安装配置mysql的时候可能会遇到需要配置my.cnf配置文件的情况
1.如果你只是想确认mysql加载的是哪个配置文件那你可以使用以下方法进行确认。
mysql --verbose --help | grep my.cnf
会得到类似以下的几个地址,默认是在/etc/下的my.cnf。
打开my.cnf 文件:
sudo vim /etc/my.cnf
输入:
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# 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]
character-set-server