Any negative effects with cPanel when changing MariaDB port?
I recently became aware of this SQL query for MariaDB:
SHOW GLOBAL VARIABLES LIKE 'log_error';
On my desktop I saw a huge almost once-per-minute probing of my desktop's MariaDB database. So I changed the port and all of the probing stopped.
Now there isn't much, ironically, going on in my live server's database error log. But I still like the idea of hardening my server against probing and other types of attacks. There is absolutely no reason why a remote IP address has any business connecting to my databases. However, cPanel adds layers and thus complications. I see plenty examples of the following:
2025-07-17 7:24:46 32719 [Warning] Access denied for user 'Cpanel::MysqlUtils::Unprivileged'@'localhost' (using password: NO)
Now that lead me to this page that clarifies what is going on, fine. So, in this case (and other scenarios that I'm not yet aware of) is cPanel looking at the my.ini to dynamically determine the port number or are there any instances where it just statically presumes the port number? The reason why I'm asking is because after I get a reply and it checks out well enough I want to avoid any non-foreseen complications with cPanel. My code is working great as I have good standards in place that I can update the port in my internal configuration at any point and literally all connections are updated instantly.
-
Hey there! I would just ensure that incoming connections to port 3306 are blocked in the firewall so no one will even see the service running. cPanel will not check for custom ports for the MySQL service so you would also need to disable monitoring if you changed the port or you'll get constant alerts.
0 -
Hi Rex! So I think I've got ModSecurity on this server though I'm not a Linux expert. I'm asking my web host's support team what, if any software running on the server would trigger constant alerts.
Using cPanel and CloudLinux would MariaDB's configuration file be
/etc/my.cnf? If so then I can change the port number there just like here on Windows, restart MariaDB via WHM and adjust the port configuration on my web platform. I will wait for my host and you to reply with any further details before I make that commitment first though.0 -
Yes, /etc/my.cnf is the configuration file for the service.
0
Please sign in to leave a comment.
Comments
3 comments