connect to database by user in mysql code example
Example 1: mysql connect command
mysql --host=localhost --user=myname --password mydb
mysql -h localhost -u myname -p mydb
Example 2: login to database mysql terminal
use DBNAME;
mysql --host=localhost --user=myname --password mydb
mysql -h localhost -u myname -p mydb
use DBNAME;