mySQL / MariaDB - Sign into mySQL or MariaDB using the mysql command

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


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.

Enter 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:


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter ecd65 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |