To connect to a MariaDB server via the command line, use the following syntax: mysql -u username -p Replace "username" with your actual username. You will be prompted to enter your password.