MySQL SSH访问、外网访问以及密码设置

2017-11-08  本文已影响38人  谢志海

SSH访问

ssh -L 127.0.0.1:<local port>:<db ip>:<db port> -N root@<remote ip>

ssh -L 127.0.0.1:27017:10.66.196.35:27017 -N root@139.199.209.76
mongo localhost:27017/admin -u cmsuser -p cms2017@666

mysql -u root -p

外网访问

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypwd' WITH GRANT OPTION;
mysql> flush privileges;

不能登录时密码设置

use mysql;
update user set password=PASSWORD("123") where user='root';
上一篇下一篇

猜你喜欢

热点阅读