zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    KVM之一:安装准备(基于CentOS6.7)
    Nginx技巧——Nginx/Apache下禁止指定目录运行PHP脚本(转自运维之美)
    (转)关于 awk 的 pattern(模式)
    form验证里使用request 和前端倒计时
    restful 在接口中获取 传过来的值
    django使用celery
    celery
    restful 在接口中获取 request.user
    码云创建一个仓库
    django中local_settings的配置
  • 原文地址:https://www.cnblogs.com/killclock048/p/9790346.html
Copyright © 2011-2022 走看看