install [email protected] for mac with brew

brew install [email protected]

#change directory
cd /usr/local/
#mysql5.7 is in Cellar
Cellar/
#my.cnf is in etc
etc/
#./var/mysql is the data directory
var/
#my.cnf
[client]
port=3306
socket=/usr/local/var/tmp/mysql/mysql.sock

[mysqld]
character-set-server=utf8mb4
port=3306
log-error=/usr/local/var/mysql/error.log
pid-file=/usr/local/var/mysql/mysql.pid
basedir=/usr/local/Cellar/[email protected]/5.7.32
datadir=/usr/local/var/mysql
tmpdir=/usr/local/var/tmp/mysql
socket=/usr/local/var/tmp/mysql/mysql.sock

#binlog
expire_logs_days=10
log-bin=/usr/local/var/log/mysql/mysql-bin.log
binlog-format=row
max_binlog_size=100M
server-id=1

#.bash_profile
export PATH=${PATH}:/usr/local/Cellar/mysql\@5.7/5.7.32/bin
source .bash_profile

#start mysql server
mysql.server start
mysql.server stop
mysql.server restart
#set password
mysqladmin -u root password dev123
#login client with password
mysql -u root -p
#mysqlbinlog is a tool for checking binlog file
mysqlbinlog --base64-output=decode-rows -v mysql-bin.000001

你可能感兴趣的:(install [email protected] for mac with brew)