How Can I Change The MySQL / MariaDB Listening Remote Access Port? Print

  • mysql, vps
  • 0

To change the remote listening port of your MySQL or MariaDB server you can edit your database my.cnf file & set the port option to the required port number.

For example:
port 12345

After you have made the necessary changes to the my.cnf file, save it & restart the MySQL / MariaDB server.

For example:
service mysql restart

To check which port MySQL or MariaDB is now listening on run netstat.

For example:
netstat -napt


Was this answer helpful?

« Back