最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

云计算上安装mysql,redis

互联网 admin 50浏览 0评论

云计算上安装mysql,redis

第一步 安装

apt-get update;
apt-get install mysql-client;
apt-get install mysql-server;

第二步 解除防火墙

root@JD:~# iptables -L  
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
MYSQL_DENY  all  --  anywhere             anywhereChain FORWARD (policy ACCEPT)
target     prot opt source               destinationChain OUTPUT (policy ACCEPT)
target     prot opt source               destination
root@JD:~# iptables -F
root@JD:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destinationChain FORWARD (policy ACCEPT)
target     prot opt source               destinationChain OUTPUT (policy ACCEPT)
target     prot opt source               destinationChain MYSQL_DENY (0 references)

第三步 添加远程访问权限

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'lottery' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)mysql> exit
Bye
root@JD:~# service mysql restart

OK

redis

apt-get install redis server

修改配置/etc/redis/redis.conf ,把原来绑定的 127.0.0.1 改为0.0.0.0
后台启动redis

nohup redis-server & #1启动
jobs            #2 查看后台运行的任务
disown       #3 从jobs中移除
jobs           #4 查看没有这个任务

嗯 远程访问以下 redis-cli -h [ip]

云计算上安装mysql,redis

第一步 安装

apt-get update;
apt-get install mysql-client;
apt-get install mysql-server;

第二步 解除防火墙

root@JD:~# iptables -L  
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
MYSQL_DENY  all  --  anywhere             anywhereChain FORWARD (policy ACCEPT)
target     prot opt source               destinationChain OUTPUT (policy ACCEPT)
target     prot opt source               destination
root@JD:~# iptables -F
root@JD:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destinationChain FORWARD (policy ACCEPT)
target     prot opt source               destinationChain OUTPUT (policy ACCEPT)
target     prot opt source               destinationChain MYSQL_DENY (0 references)

第三步 添加远程访问权限

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'lottery' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)mysql> exit
Bye
root@JD:~# service mysql restart

OK

redis

apt-get install redis server

修改配置/etc/redis/redis.conf ,把原来绑定的 127.0.0.1 改为0.0.0.0
后台启动redis

nohup redis-server & #1启动
jobs            #2 查看后台运行的任务
disown       #3 从jobs中移除
jobs           #4 查看没有这个任务

嗯 远程访问以下 redis-cli -h [ip]

发布评论

评论列表 (0)

  1. 暂无评论