bash: mysql: command not found

mysql找不到命令

linux输入mysql没有启动


1.命令都是保存在/usr/bin下,找不到命令一定是没有在bin下创建链接

可以通过ls查看bin下的所有命令

ls /usr/bin

2.下一步找到mysql的命令的位置

find -name mysql

3.创建链接:我的是在这个目录下/usr/local/mysql/bin/mysql

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

4.再次启动mysql

mysql

出现这样的结果就是成功了

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 148
Server version: 5.6.39 Source distribution

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

更多推荐

mysql: command not found 找不到mysql命令