Use -P parameter, like this:
mysql -h 127.0.0.1 -P 3307 -u user_name -p database_name
Important: if you connecting to localhost – use -h 127.0.0.1, NOT localhost, because MySQL will connect by file socket, not by TCP
Use -P parameter, like this:
mysql -h 127.0.0.1 -P 3307 -u user_name -p database_name
Important: if you connecting to localhost – use -h 127.0.0.1, NOT localhost, because MySQL will connect by file socket, not by TCP