0%

MacOs catlina安装mysql

mac下mysql装到docker真的没意思,装虚拟机也是无聊。
< !–more–>
官网看了下最新版本是
mysql-8.0.21-macos10.15-x86_64.dmg

用不到,找到5.7把
官网地址
https://dev.mysql.com/downloads/file/?id=496479

直连地址 ,迅雷
https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.31-macos10.14-x86_64.dmg

安装完成 输入mac用户密码
提示 里面有密码 记住免得麻烦

2020-08-23T04:37:45.309952Z 1 [Note] A temporary password is generated for root@localhost: ruessO/d)2GT

If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
系统偏好设置 找到mysql

启动
macos shell输入

1
2
cd /usr/local/mysql/bin
mysql -uroot -p #回车后输入密码

5.7.6开始要用这个命令了,我们是5.7.31所以也一样

1
ALTER USER USER() IDENTIFIED BY '123456';

允许其他设备连接,因为我们是局域网内所以不用担心

1
2
update mysql.user set host = '%' where user = 'root';
flush privileges;

完毕