I then remember there's something I need to change for mysqld on the server side.
Looking into old notes, I found the setting below needs to be added:
Code: Select all
skip-character-set-client-handshake
In Centos 8/Rocky 8, it needs to be added in /etc/my.cnf.d//etc/my.cnf.d.
After this, mysql command and CGI started to work.