Error:
[Email protected] ~]# mysql-u root
-bash:mysql:command not found
Cause: This is because the system will find the command under/usr/bin by default, if this command is not in this directory, of course, will not find the command, we need to do is to map a link to the/usr/bin directory, equivalent to create a link file.
The first thing you need to know is the full path to the MySQL command or mysqladmin command, such as the path to MySQL:/usr/local/mysql/bin/mysql, we can execute the command like this:
# ln-s/usr/local/mysql/bin/mysql/usr/bin
Here are the additions:
Under Linux, in the case of MySQL normal operation, enter the MySQL prompt:
MySQL command not found
Encounter-bash:mysql:command not found situation, this is because the/usr/local/bin directory is missing MySQL, only need a way to establish a soft link, that can be resolved:
Map the MySQL installation directory, such as Mysqlpath/bin/mysql, to the/usr/local/bin directory:
# Cd/usr/local/bin
# ln-fs/mysqlpath/bin/mysql MySQL
There are other commonly used commands such as mysqladmin, mysqldump, etc. can be resolved by this method when not available.
Note: Where Mysqlpath is the actual installation path of MySQL
Workaround for Linux mysql command bash:mysql:command not found