mysql login database code example Example 1: login mysql mysql -u root -p Example 2: mysql cli connect with password mysql --user=root --password=mypass