#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(你的 ...
随机推荐
- Consistent hashing —— 一致性哈希
原文地址:http://www.codeproject.com/Articles/56138/Consistent-hashing 基于BSD License What is libconhash l ...
- mariadb配置允许远程访问方式
首先配置允许访问的用户,采用授权的方式给用户权限 1 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRAN ...
- (转) 浅析HTML5在移动应用开发中的使用
(转)浅析HTML5在移动应用开发中的使用 (原)http://www.iteye.com/magazines/67 2012-03-07 来自 UECD.163.com 编辑 wangguo ...
- css中文乱码与替换字符
有时候,我们的css样式表中字体乱码,很诧异.百度谷歌是两个老师,有时jquery博客还上淘宝,那边有现成的代码,看看,发现里面定义全局字体是这样的font:12px/1.5 tahoma,arial ...
- CxImage图像库的使用 .
http://blog.csdn.net/wangjie0377/article/details/7830405 CxImage图像库 CxImage下载地址:http://www.codeproje ...
- JS简介
JS是一本广泛应用于浏览器客户端的脚本语言,由netspace公司设计,当时和sun公司合作,所以名字取得像java JS的常见用途:1)HTML DOM操作(节点操作,比如添加.修改.删除节点 ) ...
- linux驱动的分离分层概念之LED
bus_drv_dev模型:功能改写只需改dev硬件代码即可,drv不需改写. LED例子 下面用一个点亮LED的例子来说明这个分离的的例子: led_dev.c 定义这个平台设备的资源: stat ...
- MSSQL—行转列
行转列,是SQL中经常会遇到的一个问题,并且分为静态转换和动态转换,所谓静态转换即在转换的行数已知或固定:动态转换则为转换的行数不固定. 转换的方法一般采用case when语句或pivot(MSSQ ...
- Cocos2d-x win7 + vs2010 配置图文详解
Cocos2d-x win7 + vs2010 配置图文详解 下载最新版的cocos2d-x.打开浏览器,输入cocos2d-x.org,然后选择Download,本教程写作时最新版本为cocos2d ...
- nginx 基本操作
nginx 是什么 nginx 是轻量.高性能的网页服务器,相较 Apache 占有内存小. 下载 https://nginx.org/en/download.html 默认根目录 安装目录下的 ht ...