To access mysql from CLI:
mysql -u <username> -p<password> <database_name>
Make sure no space between
-p
and password. Of course, this password will be visible in history.
To overcome this:
- Leave it blank and it will ask you for it.
- start the command with a space in front of
mysql