Bobcares

UFW MySQL- How we enable it easily?

by | Nov 6, 2019

Are you trying to figure out UFW MySQL?

MySQL services can be easily implemented using UFW. To do so, we need to open the port 3306.

At Bobcares, we often receive requests to enable MySQL using UFW as part of our Server Management Services.

Today, let’s discuss this in detail and see how our Support Engineers do it easily.

 

More about UFW MySQL

As we all know, Linux is best known for its security. And, iptables contribute it’s best to enhance this security.

But, complex iptables made users prefer a much simpler front end for it.

And, Uncomplicated Firewall or UFW is a front-end for iptables that is best suitable for host-based firewalls.

It provides a framework for managing Netfilter and a command-line interface for working with the firewall.

To connect to the MySQL database, we need to open the port 3306. MySQL listens for client connections on port 3306.

So, let’s now check how we do this in UFW.

 

How we enable MySQL in UFW

Recently, one of our customers approached us with a query related to UFW. He has a UFW firewall installed but not being able to connect to MySQL.

Our Support Engineers checked and found that the port 3306 was not open the firewall.

So, if we need to connect to the MySQL database server, we need to allow the traffic in the firewall.

For that, we need to open the port 3306. We can open the port by using the port number or with service name.

ufw allow 3306

or

ufw allow mysql

 

Allow MySQL from Specific IP Address or Subnet

To allow incoming MySQL connections from a specific IP address or subnet, we use the command,

ufw allow from IP/subnet to any port 3306

Here, we replace the IP/subnet using the required IP address or the entire subnet that is to be allowed.

For instance, if we want to allow the entire subnet 1x.2x.1x.0/24, we use the command as,

ufw allow from 1x.2x.1x.0/24 to any port 3306

 

Allow MySQL to Specific Network Interface

Similarly, sometimes we require to allow MySQL connections to a specific network interface.

In such cases, we use the following command,

ufw allow in on network_interface to any port 3306

This will help to have MySQL connections to the private network interface.

ufw allow in on eth1 to any port 3306

For instance, if we want to allow a private network interface eth1. We use the command

 

[Need more assistance to enable MySQL in UFW?- We’ll help you.]

 

Conclusion

In short, enabling MySQL in UFW includes opening the port 3306. In today’s article, we discussed how our Support Engineers allow MySQL connection for a specific IP address and interface.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF