/usr/local/mysql/bin/mysql -u root -proot
all PRIVILEGES on *.* to root@'%'identified by 'root';
flush privileges;//更新规则

phpmyadmin也可以修改远程连接,把root用户IP地址修改为%
flush privileges;//更新规则
即可远程连接

yum -y install ppp

wget -c http://code-jinchengjiang.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.x86_64.rpm
rpm -ivh pptpd-1.3.4-1.rhel5.1.x86_64.rpm

wget -c http://code-jinchengjiang.googlecode.com/files/pptpd-1.3.4-1.rhel5.1.i386.rpm
rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm

sed -i 's/#ms-dns 10.0.0.1/ms-dns 10.242.197.247/' /etc/ppp/options.pptpd
sed -i 's/#ms-dns 10.0.0.2/ms-dns 10.242.197.248/' /etc/ppp/options.pptpd

sed -i 's/#localip 192.168.0.1/localip 192.168.0.1/' /etc/pptpd.conf
sed -i 's/#remoteip 192.168.0.234-238,192.168.0.245/remoteip 192.168.0.234-238,192.168.0.245/' /etc/pptpd.conf

sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/' /etc/sysctl.conf
sysctl -p

echo -e "用户 pptpd 密码 *" /etc/ppp/chap-secrets

service iptables start
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT

#xen
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth1 -j MASQUERADE

#Openvz
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source 你的VPS的IP

service iptables save
service iptables restart
service pptpd start
chkconfig pptpd on

vi /etc/sysctl.conf找到下面行 //启用数据转发.
net.ipv4.ip_forward = 0 改成 net.ipv4.ip_forward = 1
执行如下命令来应用:sysctl -p 或重启
加入iptables规则
iptables -t nat -I PREROUTING -p tcp –dport 端口 -j DNAT –to 转发IP地址
iptables -t nat -I POSTROUTING -p tcp –dport 端口 -j MASQUERADE
service iptables save //保存规则
service iptables restart //重启生效

欢迎使用WordPress。这是系统自动生成的演示文章。编辑或者删除它,然后开始您的博客!