---
title: "How to Fix the Security Advisor MySQL Alert"
description: "The WHM Security Advisor scans for possible changes to harden your VPS security. Below we cover how to clear the following error for VPS users not using remote MySQL: The MySQL service is configured..."
url: https://www.inmotionhosting.com/support/security/how-to-fix-security-advisor-mysql-alert/
date: 2018-09-11
modified: 2021-11-19
author: "InMotion Hosting Contributor"
categories: ["Security", "Working with Databases"]
type: post
lang: en
---

# How to Fix the Security Advisor MySQL Alert

The WHM **Security Advisor** scans for possible changes to harden your VPS security. Below we cover how to clear the following error for VPS users not using remote MySQL:

*The MySQL service is configured to listen on all interfaces: (bind-address=*)

Configure bind-address=127.0.0.1 in /etc/my.cnf, or close port 3306 in server’s firewall*

## Security Advisor Scan

1. To check for the **MySQL service** warning, first [Login WHM](/support/edu/whm/log-into-whm/#whm-root-access) as root.
2. Select **Security Advisor** from the menu to start the scan. [![Screenshot in WHM selecting Security Advisor](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-1.png)](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-1.png)
3. Check for the **MySQL service alert**. [![MySQL port open Security Advisor alert](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-1-scan.png)](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-1-scan.png)

If the alert above does display, you can fix this using one, or both, of the following methods:

[Edit Config File](#bind) [Close Port 3306](#firewall)

**Note**: This may prevent your VPS from using [remote MySQL](/support/website/setting-up-a-remote-mysql-connection-in-cpanel/).

## Edit Config File

1. [SSH into your server](/support/server/ssh/how-to-login-ssh/) as root.
2. Edit the /etc/my.cnf file and add bind-address=127.0.0.1 to the file. To do so using nano editor: Type nano /etc/my.cnf and press Enter ⤶ to open the file. Scroll to the bottom of the file using the Down arrow and add bind-address=127.0.0.1 . Press Control and x for the save prompt before exiting. Press y , then Enter ⤶ to save the file. [![Screenshot adding code to my.cnf](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-2-myconf.png)](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-2-myconf.png)
3. Afterwards, rescan with **cPanel Security Advisor** to ensure the error doesn’t recur.

## Close Port 3306 using CSF

Another option is to **close port 3306** using your firewall. **Advanced Policy Firewall (APF)** users can remove the port from the [APF configuration file](/support/security/allow-ports-apf/) using SSH as root. **ConfigServer & Firewall (CSF)** users can do this within WHM as root using the steps below.

1. Select **ConfigServer Security & Firewall** from the WHM menu.
2. Under *csf – ConfigServer Firewall* select **Firewall Configuration**. [![CSF selecting Firewall Configuration](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-3-block-3306-1.png)](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-3-block-3306-1.png)
3. Under *IPv4 Port Settings* and **Allow incoming TCP ports**, remove “*3306*” from the text field. [![Removing port 3306](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-4-block-3306-2.png)](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-4-block-3306-2.png)
4. Select **Change** at the bottom, then **Restart csf+lfd**. [![Restarting CSF and LFD](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-6-block-3306-4.png)](https://www.inmotionhosting.com/support/images/stories/whm/whm-security-advisor-mysql-6-block-3306-4.png)
5. Afterwards, rescan with **cPanel Security Advisor** to ensure the error doesn’t recur.

Congratulations. You’ve further enhanced your VPS security. APF users can upgrade to CSF [using our installation guide](/support/security/install-csf/) or via [verified email request](/support/amp/submitting-and-checking-on-status-of-tickets/#submit-ticket).
