赞
踩
1.MySQL:https://www.mysql.com/downloads/
在界面下载社区版的Mysql Mysql Community(GPL) Downloads—MySQL Community Server—macOS 12 (x86, 64-bit), DMG Archive
2.Navicat:https://www.navicat.com.cn/download/navicat-for-mysql#mac
一定要记住自己设置的密码
MySQL安装成功后,用户默认只支持本地访问,无法远程访问,这时需要新建远程访问用户,用于Navicat连接到mysql(不然会报错:2002 - Can’t connect to server on ‘127.0.0.1’ (36))。
打开终端,输入:/usr/local/MySQL/bin/mysql -u root -p
输入密码,进入mysql
用户信息的 user 表存在mysql数据库中
输入:use mysql;
输入:select host, user, authentication_string, plugin from user;
表格中 root 用户的 host默认显示的 localhost,不能远程访问。
在上图的命令行中输入:GRANT ALL ON . TO ‘root’@‘%’;
报错,The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
如果测试失败,确认mysql是否设置了远程访问。
点击保存,就配置成功了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。