MySql安装可参考超级详细的mysql数据库安装指南 - 知乎
连接Navicat报错1130-Host ‘1xxx.xx.x.20‘ is not allowed to connect to this MySQL server的解决办法,当时未截图,借用网上图展示,如图所示:
此错误指的是本地IP(xxx.xxx.xxx.xxx)没有访问远程数据库的权限,可用cmd设置访问权限,
管理员模式cmd 进入MySql 安装bin目录下:mysql -u root -p
2、输入查询用户命令
use mysql;
select user,host from user; #通过结果发现权限只有localhost,需要修改权限
# 修改root用户为不限制远程访问
update mysql.user set host = '%' where user='root';
flush privileges;
END: Mysql 其他相关命令
//创建用户,并赋予zhhjkj这个用户增删改查权限
use mysql;
select * from user;
create user 'zhhjkj'@'%' identified with mysql_native_password by 'zhhj,2023';
flush privileges;
grant all privileges on *.* to 'zhhjkj'@'%' with grant option;
flush privileges;
select * from user;