Assuming you have mySQL or MariaDB installed on a Linux system, the which command can be used to determine if the mysql command line tool is installed. In this example, the mysql command line tool is installed.
~]# which mysql /bin/mysql
The mysql command line tool can be used to sign into mySQL or MariaDB. By default, after a clean install of mySQL or MariaDB, you should be able to connect to the database as root on the system that mySQL or MariaDB has been installed on.
~]# mysql -u root
Assuming you have NOT setup passwordless authentication for root, you should be prompted for root password.
Assuming you are able to enter a valid password, something like this should be displayed.
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 26 Server version: 10.5.10-MariaDB-log MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
If you want to be able to connect to mySQL or MariaDB from a remote system, refer to: