Remember to map mysql 3306 port to the external network frp

FRP installation requirements

  1. Public IP
  2. FPR client and server software versions are consistent

You can directly purchase a cloud server with a public IP, which is very cost-effective for ordinary students and first orders. At the end of the article, Alibaba Cloud and Tencent Cloud connections are attached!

If you have any questions, please leave a message directly and do your best!

Start command

Start frp of the accessed machine through the following command

nohup ./frps -c ./frps.toml  &

Remember to map mysql 3306 port to the external network

pit

  • mysql itself is not configured for remote access

  • frp configuration error, did not pay attention to the difference between Chinese single quotes and English single quotes

mysql itself is not configured for remote access

Problem: Lost connection to MySQL server at ‘reading initial communication packet’ appears when navacat remotely connects to mysql. Solution

The analysis should be caused by the following two reasons:

服务器有防火墙,禁止3306端口的访问。
用户没有授权远程访问。

MySQL 8.x settings allow remote access

update user set host='%' where user='root';

#再执行两次

GRANT ALL ON *.* TO 'root'@'%';

# 所有操作后,应执行
flush privileges;

First enter my.cnf on linux. It is usually in /etc/my.cnf. If it does not exist, create it yourself.

Comment out the bind-address line in my.cnf. Whether it is bind-address=127.0.0.1 or bind-address=0.0.0.0, comment out the bind-address line.

Add skip-name-resolve to my.cnf

Restart the mysql service: service mysql stop, service mysql start or just say service mysql restart

rp configuration error, did not pay attention to the difference between Chinese single quotes and English single quotes

reference

The intranet penetration tool frp is simple to use and can access the designated port of the intranet machine - Zhihu

Failed to connect to MySQL database remotely 2013-Lost connection to MYSQL server at ‘reading for initial communication packet‘_2013 - lost connection to mysql server at 'reading-CSDN Blog

MySQL8.0 sets remote access permissions - Zhihu

TCP & UDP | frp

Load balancing and health checking | frp

FRP multi-port configuration, please note that the title must be different, frp version 0.52.3

# frpc.toml
[[proxies-test1]]
name = "test1"
type = "tcp"
localPort = 8080
remotePort = 80
loadBalancer.group = "web"
loadBalancer.groupKey = "123"

[[proxies-test2]]
name = "test2"
type = "tcp"
localPort = 8081
remotePort = 80
loadBalancer.group = "web"
loadBalancer.groupKey = "123"

 

Server purchase recommendations

Ali Cloud

Tencent Cloud

Guess you like

Origin blog.csdn.net/qq_34068440/article/details/134688746