- 启动MySQL服务
sudo /usr/local/mysql/support-files/mysql.server start
- 停止MySQL服务
sudo /usr/local/mysql/support-files/mysql.server stop
- 重启MySQL服务
sudo /usr/local/mysql/support-files/mysql.server restart
- mysql在新版中去掉了默认配置文件my.cnf如果需要可以手动创建
注意区分:
mac版mysql与Windows版的mysql配置文件扩展名不同:- mac下: my.cnf
- windows下: my.ini
- 在 /etc 新建 my.cnf 文件
sudo vim 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
#passw