Typically the command is:
/usr/local/mysql/bin/mysql -u root -p
which will prompt you for your root password (which might be blank unless you changed it)
You can also use:
/usr/local/mysql/bin/mysql -u root -p[password]
but keep in mind that password will be visible onscreen as you are typing it unlike the straight -p option that will hide your password as you type it when prompted.
Take a look at the options for mysql: https://dev.mysql.com/doc/refman/5.6/en/mysql-command-options.html
In your case, I'd try /usr/local/mysql/bin/mysql -u root -p then hit enter. mysql will prompt you for your password - type in in and hit enter again. If it's wrong mysql will let you know and then you'll have to go about resetting the mysql root password.
https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/ is a reasonable set of instructions for doing that in OS X (may be out of date for your version of MySQL but the comments will help) but YMMV depending on where mysql was installed, etc...
Basically those instructions are:
sudo /usr/local/mysql/support-files/mysql.server stop
sudo mysqld_safe --skip-grant-tables
mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED by 'password';
FLUSH PRIVILEGES;
exit
sudo /usr/local/mysql/support-files/mysql.server start
Which
- Stops mysql
- Sets mysql to run without bothering with privileges
- Opens a mysql prompt
- Updates the root password to 'password' - you should use something else here.
- "Cleans" passwords (some might say this is unnecessary)
- Exits the mysql prompt
- Starts mysql
That should allow you to run mysql -u root -p and use the new password set in #4.
-poption), so your login was denied. If you DIDN'T have the mysql client, you'd get "no such command" or whatever.2016-07-05T15:36:38.772955Z 1 [Note] A temporary password is generated for root@localhost: 6_fQx:dfS9H; If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.6_fQx:dfS9H, it still reportedAccess deniedSET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');, Go back and ditch that info from your cnf and save. That cnf can be your best friend, a problem that gets in the way of login, or a major security risk, Restart mysql daemon