Home >Database >Mysql Tutorial >解决bash: mysql: command not found 的方法

解决bash: mysql: command not found 的方法

WBOY
WBOYOriginal
2016-06-07 17:55:351720browse

解决bash: mysql: command not found 的方法,需要的朋友可以参考一下

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


原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下,当然会找不到命令,我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件。
首先得知道mysql命令或mysqladmin命令的完整路径,比如mysql的路径是:/usr/local/mysql/bin/mysql,我们则可以这样执行命令:

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn