Since I installed MySQL, it only allows me to connect like this:
/usr/local/mysql/bin/mysql -u user -p
I would like to know how I can connect in this other way:
mysql -u user -p.
Without having to specify the full path, because it's a bit awkward. Someone who knows what I should do to change the way to connect to MySQL.
I am on Mac OS, I have version 5.7.21.
1 you can make a symbolic link to the mysql executable inside the folder
/urs/local/bin
this path should be in the path and any command you write if it exists there it is not necessary to put the full path2 you can also add
/usr/local/mysql/bin/
to the pathway 2 is recommended if you are going to use
mysqldump
and other tools that are in the mysql bin3 add to the path only in your console profile: search for a file
.profile
or edit it.bash_profile
in your user folderhome
and put the following line at the end:Way 3 is the least intrusive, way 2 is global (it asks for admin password), way 1 is generic for a single executable (it will also ask for admin permission)