login to mysql database command line code example Example 1: login to database mysql terminal mysql -u USERNAME -p Example 2: login to database mysql terminal use DBNAME;