login to mysql
snippet in sql

mysql cmd command to run

user9639

mysql.exe –uroot –p

login to mysql

user5420

mysql -u USERNAME -p

login mysql

user4445

mysql -u root -p

login to database mysql terminal

user7124

use DBNAME;

how to connect to the database as root user in linux

user6434

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';