远程连接mysql和redis配置

远程连接Redis配置流程

  • 配置流程

     
     
     
    xxxxxxxxxx
    10
     
     
    1
    【1】修改配置文件
    2
        sudo gedit /etc/redis/redis.conf
    3
        修改如下2个内容后保存退出:
    4
           # bind 127.0.0.1 ::1  把此行注释掉
    5
           protected-mode no     把默认的yes改为no
    6
    
    
    7
    【2】重启redis服务
     
     
    8
        sudo /etc/init.d/redis-server restart
    9
    
    
    10
    【3】远程连接测试(在远程机器上)
    11
        redis-cli -h IP地址
     
     

远程连接MySQL配置流程

  • 配置流程

     
     
     
    xxxxxxxxxx
    10
     
     
     
     
    1
    【1】修改配置文件,允许远程连接
    2
        sudo gedit /etc/mysql/mysql.conf.d/mysqld.cnf
    3
        将如下行注释并保存退出:
    4
         # bind-address = 127.0.0.1
    5
    
    
    6
    【2】给用户授权
    7
        mysql -uroot -p123456
    8
        mysql> grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
    9
        mysql> flush privileges;
    10
    
    
    11
    【3】重启MySQL服务
    12
        sudo /etc/init.d/mysql restart
    13
    
    
    14
    【4】远程连接测试(远程服务器上)
    15
        mysql -hIP地址 -uroot -p123456
     
     

     

posted @ 2020-09-14 17:25  爱吃萝卜爱吃兔  阅读(897)  评论(0编辑  收藏  举报