I have a problem with the handling of the mysql command.
When I try to use mysql -uroot -p, I get an error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
However, when I try to use ./mysql -uroot -p
from /data/local/tool/mysql-5.6.21/bin, I can connect to MySQL.
So I assume that mysql and ./mysql have different meanings.
whereis mysql output:
# using new line to look easier
/usr/bin/mysql
/usr/lib64/mysql
/usr/include/mysql
/usr/share/mysql
/data/local/tool/mysql-5.6.21/bin/mysql
The problem is that when I run which mysql, the output shows /bin/mysql.
So how do I tell bash it should pick MySQL
from /data/local/tool/mysql-5.6.21/bin/mysql
whenever I run mysql (without ./)?