使用brew包管理器安装mysql默认的安装路径
/usr/local/Cellar/mysql@5.7/5.7.29
数据库的配置文件路径
/usr/local/etc
1、编辑my.cnf:在最后增加一句:
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
vim /usr/local/etc/my.cnf
# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
2、重启mysql
brew services restart mysql@5.7
严格模式已关闭!
网友评论