navicat远程连接mysql,2003 can't connect to mysql server on 10038

navicat远程连接mysql,2003 can't connect to mysql server on 10038
参照URL:https://blog.csdn.net/makeworks/article/details/77844386

①:netstat -an | grep 3306
来查看mysql默认的端口3306是否开启,允许哪个ip使用,如果你发现,前面有127.0.0.1,就说明,3306端口只能本机ip使用
所以,我们需要

②:打开mysql配置文件 sudo vi /etc/mysql/mysql.conf.d/server.cnf  或者my.ini
将bind-address = 127.0.0.1注销​
或改为bind-address = 0.0.0.0


③:进入mysql,mysql -u root -p
输入密码
对远程用户进行授权,
grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx';
这里的root 是你远程登录的用户,xxxxxx是你登录使用的密码,然后可以在mysql数据 表中查看到你这个用户已经被添加到user表中。
MariaDB [mysql]> grant all privileges on *.* to root@"%" identified by '123qwe!@#' with grant option;

④:修改生效,mysql>FLUSH PRIVILEGES;

⑤:退出,mysql>EXIT

⑥:重启MySQL服务,service mysqld restart

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123qwe!@#' WITH GRANT OPTION;
FLUSH PRIVILEGES;

上記の方法が試した、出来なければ、下記の命令を行って試します
systemctl stop firewalld
firewall-cmd --zone=public --add-port=3306/tcp --permanent
systemctl start firewalld

https://blog.csdn.net/aiming66/article/details/78880094?foxhandler=RssReadRenderProcessHandler

转载于:https://www.cnblogs.com/killclock048/p/9790346.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值