查找并确定自己需要安装的版本
brew search mysql
==> Formulae
automysqlbackup mysql-connector-c [email protected]
mysql mysql-connector-c++ [email protected]
mysql++ mysql-sandbox [email protected] ?
mysql-client mysql-search-replace mysqltuner
mysql-cluster mysql-utilities
==> Casks
mysql-connector-python mysql-utilities navicat-for-mysql
mysql-shell mysqlworkbench sqlpro-for-mysql
安装[email protected]
brew install [email protected]
# 安装成功后,会看到这样的提示
/usr/local/Cellar/mysql/5.7.9/bin/mysqld --initialize-insecure --user=comet
==> Caveats
We‘ve installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
可以看到brew在安装的时候已经初始过mysql了(不用再像网上说的再执行mysql_install_db命令),且当前没有密码于是我按照它的提示,执行命令:
mysql_secure_installation
按照提示设置密码即可
配置密码
原文地址:https://www.cnblogs.com/huyifei/p/10276254.html
时间: 2024-10-04 10:26:59