root@db-02 ~]# mysql-u Root
-bash:mysql:command not found
Reason: This is because the system by default will look for commands under/usr/bin, if this command is not in this directory, of course, will not find the command, we need to do is map a link to the/usr/bin directory, the equivalent of creating a linked file.
First you need to know the full path to the MySQL command or mysqladmin command, such as the MySQL path is:/usr/local/mysql/bin/mysql, we can execute the command:
# ln-s/usr/local/mysql/bin/mysql/usr/bin
The following are supplementary:
Linux, in the case of MySQL normal operation, enter the MySQL prompt:
MySQL command not found
Encounter-bash:mysql:command not found situation do not worry, this is because the/usr/local/bin directory is missing MySQL caused, only need a way to establish soft links, that can be resolved:
The MySQL installation directory, such as Mysqlpath/bin/mysql, map to the/usr/local/bin directory:
# Cd/usr/local/bin
# ln-fs/mysqlpath/bin/mysql MySQL
There are other commonly used commands mysqladmin, mysqldump and so on can be used in this way to solve.
Note: Where Mysqlpath is the actual installation path for MySQL