First of all, you must know the full path of the mysql command or mysqldump command. You can use the find command to find it.
Unless you know the mysql installation path, you can skip this step.
find / -name mysql -print
For example, the path of my mysql is: /usr/local/mysql/bin/mysql, and then map a link to the /usr/bin directory, which is equivalent to creating a link file
ln -fs /usr/local/mysql/bin/mysql /usr/bin
mysqldump is the same, where /usr/local/mysql/ is the installation path of mysql.