mac下载mysql
1.如果对版本没有特别要求,那么直接使用brew install mysql
安装即可。
2.使用 brew services start mysql
启动mysql。
3.使用 mysql -u root
登录mysql,这个时候还是不需要密码的
4.退出数据库:exit
5.给root设置一个密码,使用 mysql_secure_installation
对数据库进行配置。
全选y
设置密码,我设置的123456
6.mysql -uroot -p123456 登录数据库