I am running mysqld v8 on Ubuntu. The service starts via systemctl.
I need to change the default port number but searching the canonical locations (e.g. my.cnf) the port number is not set any any instance of that file.
Based upon the docs I can change the port on the command line for mysqld but I am not seeing how to change it for systemctl.
2
Answers
It’s a system variable. Its name is
port
.In the file where your configuration is (possibly
/etc/mysql/mysql.conf.d/mysqld.cnf
) you should have a section ofinside this section make sure you have something like