connect terminal to mysql code example Example 1: mysql cmd command to run mysql.exe –uroot –p Example 2: login to database mysql terminal use DBNAME;