mysql问题处理(报错代码 -bash:mysql:command not found)
问题为:
[[email protected] bin]# mysql -u root -p
-bash: mysql: command not found #报错
我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件。首先得知道mysql命令或mysqladmin命令的完整路径,比如mysql的路径
是:/www/lanmps/mysql5.7.17/bin/mysql,我们则可以如下这样执行命令:
[email protected] bin]# ln -s /www/lanmps/mysql5.7.17/bin/mysql /usr/bin
[[email protected] bin]# mysql -u root -p
Enter password: #(默认为空密码)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17 Source distribution
Copyright (c) 2000, 2016, 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)