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

Posted 不刷牙的大虫子

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 [email protected]"%" identified by ‘[email protected]#‘ with grant option;

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

⑤:退出,mysql>EXIT

⑥:重启MySQL服务,service mysqld restart

GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘[email protected]#‘ 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


































以上是关于navicat远程连接mysql,2003 can't connect to mysql server on 10038的主要内容,如果未能解决你的问题,请参考以下文章

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

通过Navicat远程连接MySQL

Navicat for mysql 远程连接 mySql数据库100611045错误

Linux系统MySQL开启远程连接

Linux环境 mysql用navicat远程连接常见问题2003 1130 1045

用Navicat连接mysql报错:2003-Can't connect to MySql server on '10.100.0.109'(10039)