Security group serves as a stateful virtual firewall with filtering feature for configuring network access control for one or more TencentDB instances. It is an important network security isolation tool provided by Tencent Cloud. Instances with the same network security isolation demands in one region can be put into the same security group, which is a logical group. TencentDB and CVM share the security group list and are matched with each other within the security group based on rules. For specific rules and limitations, see Security Group Overview.
Note:
- TencentDB for MySQL security groups currently only support network access control for VPCs and public networks but not the classic network.
- As TencentDB doesn't have any active outbound traffic, outbound rules don't apply to it.
- Security groups are supported for source, read-only, and disaster recovery TencentDB for MySQL instances.
Template | Description | Description |
---|---|---|
Open all ports | All ports are opened to the public and private networks. This may pose security issues. | - |
Open ports 22, 80, 443, and 3389 and the ICMP protocol | Ports 22, 80, 443, and 3389 and the ICMP protocol are opened to the public network. All ports are opened to the private network. | This template doesn’t take effect for TencentDB. |
Custom | You can create a security group and then add custom rules. For more information, see Add a security group rule. | - |
Source or Target | Description |
---|---|
A single IPv4 address or an IPv4 range | In CIDR notation, such as 203.0.113.0 , 203.0.113.0/24 or 0.0.0.0/0 , where 0.0.0.0/0 indicates all IPv4 addresses will be matched. |
A single IPv6 address or an IPv6 range | In CIDR notation, such as FF05::B5 , FF05:B5::/60 , ::/0 or 0::0/0 , where ::/0 or 0::0/0 indicates all IPv6 addresses will be matched. |
ID of referenced security group. You can reference the ID of:
|
|
Reference an IP address object or IP address group object in a parameter template. | - |
Note:To connect to a TencentDB for MySQL instance, you must open its port. You can log in to the TencentDB for MySQL console, click an instance ID to enter the instance details page.
- TencentDB for MySQL uses private network port 3306 by default and supports customizing the port. If the default port is changed, the new port should be opened in the security group.
- The TencentDB for MySQL public port is automatically assigned by the system and cannot be customized. After the public network access is enabled, it will be controlled by the ACL of the security group. When configuring the security policy, you need to open the private port 3306.
- The security group rules displayed on the Security Group page in the TencentDB for MySQL console take effect for private and public (if enabled) network addresses of the TencentDB for MySQL instance.
Scenario: You have created a TencentDB for MySQL instance and want to access it from a CVM instance.
Solution: When adding security group rules, select MySQL(3306) in Type to open port 3306.
You can also set Source to all or specific IPs (IP ranges) as needed to allow them to access TencentDB for MySQL from a CVM instance.
| Inbound or Outbound | Type | Source | Protocol and Port | Policy |
| Inbound | MySQL(3306) | All IPs: 0.0.0.0/0
Specific IPs: Specify IPs or IP ranges | TCP:3306 | Allow |
A security group is an instance-level firewall provided by Tencent Cloud for controlling inbound traffic of TencentDB. You can associate a security group with an instance when purchasing it or later in the console.
Note:Currently, security groups can be configured only for TencentDB for MySQL instances in VPC.
Note:As existing rules will be overwritten after importing, we recommend that you export the existing rules before importing new ones.
Was this page helpful?