Introduction
In a few cases, we need to have remote connections be available but still need some little extra security. One good way for this is to change the MySQL port so it's different from the default and not getting hit as many times from bots.
Please keep in mind that changing your MySQL port is an unsupported configuration of MySQL and best if a system administrator makes these changes and monitors the server. Some things may break on the server, particularly websites that are developed to use the default MySQL port.
We're happy to help as much as possible but our technical analysts aren't replacements for a qualified systems administrator. We've provided the data and information that will help you carry on to the next step.
For a list of System Administration Services, feel free to reference our public services guide here: System Administration Services
Please note, however, that cPanel cannot be held liable for any services performed by third-party providers.
Procedure
To change the MySQL port, we can add a port flag into your /etc/my.cnf. For example, if we are changing the port to 11232 then the line in the /etc/my.cnf will look like this:
port=11232
Once this has been set, we will then go through and restart MySQL using the steps in this guide.
After restarting MySQL, we can check to see if the port has been allocated to MySQL using the Netstat command. If things went well then your command and output should look similar to this:
# netstat -tlpn | grep mysql
tcp6 0 0 :::11232 :::* LISTEN 12935/mysqld
Comments
0 comments
Article is closed for comments.