#mysql:command not found
一、问题描述
1、在linux中已经安装好mysql,通过#ps -ef |grep mysql 能显示mysql已经启动,但去进入mysql命令页面出现如下问题:
[root@root ~]# mysql u -p
-bash: mysql: command not found
查找mysql是否已经启动
[root@root ~]# ps -ef | grep mysql
root 1172 1 0 18:28 ? 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/service/mysql --pid-file=/service/mysql/root.pid
mysql 1285 1172 9 18:28 ? 00:00:01 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/service/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/service/mysql/root.err --pid-file=/service/mysql/root.pid
root 1440 1288 0 18:28 pts/1 00:00:00 grep mysql
2、查找问题产生原因:
原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下,当然会找不到命令,我们需要做的就是映射一个链接到/usr/bin目录下,相当于建立一个链接文件。
首先得知道mysql命令或mysqladmin命令的完整路径,比如mysql的路径是:/usr/local/mysql/bin/mysql,【此路经是mysql实际安装路径】我们则可以这样执行命令
[root@root bin]# ln -fs /usr/local/mysql/bin/mysql /usr/bin/
3、连接mysql
[root@root bin]# mysql -u -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.20 Source distribution Copyright (c) 2000, 2014, 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> Ctrl-C -- exit!
Aborted
#mysql:command not found的更多相关文章
- # mysql -u root -p -bash: mysql: command not found
[root@jboss ~]# mysql -u root -p-bash: mysql: command not found 需要安装mysql # yum install mysql之后就行 了
- mysql 乱码问题(程序界面显示正常,mysql command line显示乱码)
今天用java写一个程序,用的是mysql数据库.界面出现乱码,然后写了一个过滤器结果了乱码问题. 但是,当我在mysql command line 中查询数据的时候,在界面上显示正常的数据,在mys ...
- 解决bash: mysql: command not found 的方法
root@DB-02 ~]# mysql -u root-bash: mysql: command not found 原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下 ...
- -bash: mysql: command not found 解决办法 (转)
root@DB-02 ~]# mysql -u root-bash: mysql: command not found 原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这个目录下 ...
- Mysql安装后打开MySQL Command Line Client闪退解决方法
1.开始菜单下;Mysql--->mysql server 5.6-->mysql command line Client ---右击,选择属性 2.在属性下查看目标位置: 3.将安装目录 ...
- (转)mysql command line client打不开(闪一下消失)的解决办法
转自:http://www.2cto.com/database/201209/153858.html 网上搜索到的解决办法: 1.找到mysql安装目录下的bin目录路径. 2.打开cmd,进入到bi ...
- 解决linux mysql命令 bash: mysql: command not found 的方法
错误: root@DB-02 ~]# mysql -u root-bash: mysql: command not found 原因:这是由于系统默认会查找/usr/bin下的命令,如果这个命令不在这 ...
- MySQL问题解决:-bash:mysql:command not found
问题: [root@linux115 /]# mysql -uroot -p -bash: mysql: command not found www.2cto ...
- Linux 下 -bash: mysql: command not found解决办法
-bash: mysql: command not found 1.vim ~/.bash_profile 最下面写 export PATH=$PATH:/usr/local/mysql/bin(你的 ...
随机推荐
- CSS巧妙实现分隔线的几种方法
单个标签实现分隔线: 点此查看实例展示 .demo_line_01{ padding: 0 20px 0; margin: 20px 0; line-height: 1px; border-left: ...
- 【zz】matlab 直方图匹配
原文地址:http://www.cnblogs.com/tiandsp/archive/2012/12/19/2825418.html 直方图匹配或叫做直方图规定化都可以,是把原图像的直方图按照给定的 ...
- Hadoop入门系列一
作者:Aitian Ma链接:https://www.zhihu.com/question/24965053/answer/102858134来源:知乎著作权归作者所有,转载请联系作者获得授权. Ha ...
- 为什么匿名内部类参数必须为final类型
1) 从程序设计语言的理论上:局部内部类(即:定义在方法中的内部类),由于本身就是在方法内部(可出现在形式参数定义处或者方法体处),因而访问方法中的局部变量(形式参数或局部变量)是天经地义的.是很自 ...
- 触发Full GC执行的情况
除直接调用System.gc外,触发Full GC执行的情况有如下四种. 1. 旧生代空间不足 旧生代空间只有在新生代对象转入及创建为大对象.大数组时才会出现不足的现象,当执行Full GC后空间仍然 ...
- 【C】制作简单的时钟减法程序
#include <stdio.h> #include <stdlib.h> #include <string.h> #define ARGC_NUM 3 #def ...
- USACO 刷水
BZOJ 1666 水.. BZOJ 1579 分层图最短路. BZOJ 1782 从一开始若某头牛停在U,那么U的子树的时间都会加一用BIT维护DFS序就行了 BZOJ 1572 贪心+堆 排序后查 ...
- iOS开发,用了ARC,引入非ARC的第三方,报错
ARC forbids explicit message sendof'dealloc' 在xcode中,打开“Build Setting”,找到“Objective-C Automatic Refe ...
- 转发 java数据结构之hashMap详解
概要 这一章,我们对HashMap进行学习.我们先对HashMap有个整体认识,然后再学习它的源码,最后再通过实例来学会使用HashMap.内容包括:第1部分 HashMap介绍第2部分 HashMa ...
- Javascript 事件对象进阶(一)拖拽的原理
拖拽原理 鼠标和Div的相对距离不变 三大事件 把拖拽加到document上 拖拽简单点来说就是不停的更改物体到页面左边&顶部的距离! 那么如何计算出物体到页面左端的距离呢? 当鼠标按下的时候 ...