mysql command error problem

root@DB-02 ~]# mysql -u root
-bash: mysql: command not found


Reason: This is because the system default looks for commands in / usr / bin, if the command is not in this directory, of course, will not find the command, we need to do is to map a link under / usr / bin directory, which is equivalent establish a link file.
First of all have to know the full path to the command mysql or mysqladmin command, such as mysql path is: / usr / local / mysql / bin / mysql, we can execute this command:

# ln -s /usr/local/mysql/bin/mysql /usr/bin

The following is added:

Under linux, mysql in the case of normal operation, enter the mysql prompt:
mysql the Command not found

Met -bash: mysql: command not found the case do not worry, this is because of the lack mysql cause under / usr / local / bin directory, just click method for establishing soft links that can be resolved:
the mysql installation directory, such as MYSQLPATH / bin / mysql, mapped to / usr / local / bin directory:
# cd / usr / local / bin
# LN -fs / MYSQLPATH / bin / MySQL MySQL

There are other common commands mysqladmin, mysqldump etc. are not available at all times by using this method resolved.
Note: where is the actual installation path MYSQLPATH the mysql

Source: https://www.jb51.net/article/34622.htm

Guess you like

Origin www.cnblogs.com/sun-sun/p/11946151.html