login mysql code example
Example 1: login mysql
mysql -u root -p
Example 2: mysql cli connect with password
mysql --user=root --password=mypass
Example 3: login to mysql
mysql -u USERNAME -p
Example 4: login to mysql database
mysql -u root -p databasename
Example 5: how to connect to the database as root user in linux
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
Example 6: login to database mysql terminal
show databases;