本人在用docker做镜像的时候,把定时任务打到镜像里,但是执行的时候发现错误日志总是报 sh: mysql: command not found ,然后开始解决问题

1)首先确认镜像有没有装mysql,一般安装目录默认是在 /usr/local/ ,如果没有,安装上

2)mysql命令没有找到,找到mysql安装目录,which mysql,也可以在上述目录查 /usr/local查找是否有mysql ,然后建立到  /usr/bin/的软链

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

因为系统默认会查找/usr/bin下的命令,所以要连接到这个目录

/usr/local/mysql55/bin/mysql 是mysql的安装目录

/usr/bin/是软链接到的目录

笔者犯了个错误,把mysql软链到了  /usr/local/bin/下,用户命令下可以执行 ,不报错,但是定时任务就会报错,等切换了就好了,这点需要注意。

linux定时任务报错mysql: command not found的更多相关文章

  1. linux 终端报错 Out of memory: Kill process[PID] [process name] score问题分析

    从Out of memory来看是内存超出了,后面的 Kill process[PID] [process name] score好像和进程有关了,下面我们就一起来看看linux 终端报错 Out o ...

  2. linux 安装报错:pkg-config not found

    linux 安装报错:pkg-config not found 使用编译安装时,在执行./configure时报如下错误: ... ... checking for pkg-config... no ...

  3. xcode报错:Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/b

    今天使用xcode编译工程发现一个问题,这里记录一下防止忘记 xcode报错: Command /Applications/Xcode.app/Contents/Developer/Toolchain ...

  4. Linux 下报错:A Java RunTime Environment (JRE) or Java Development Kit (JDK) must解决方案

    一.报错环境:在Linux mint下,前几天还用得很好的的eclipse,今天开机不知为什么这样. Linux 下报错:A Java RunTime Environment (JRE) or Jav ...

  5. windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help

    windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help 在windows8操作系统上安装 ...

  6. Mac打开Terminal报错-bash : : command not found

    问题描述: Mac系统在打开Terminal的时候,报错-bash : : command not found. 问题分析: 报错并不影响Terminal的使用,于是忽略不计.但是在修改.bash_p ...

  7. mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file

    mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...

  8. Linux 系统报错 rcu_preempt detected stalls on CPUs/tasks

    说在前面的一些废话: 这是什么错误我不知道,为什么出现我不知道! 那为什么还要把他写出来了,只是因为这个错误遇到了,而且浪费了我很多时间和精力. 故事留给自己看,解决办法就是,重新升级一下Linux系 ...

  9. linux ssh 报错failed - POSSIBLE BREAK-IN ATTEMPT

    linux ssh 报错failed - POSSIBLE BREAK-IN ATTEMPT 问题故障: 今天在新租的虚拟机上,发现ssh登陆机器的时候报错,如下: [root@pictures_ne ...

随机推荐

  1. 2014 ACM-ICPC Beijing Invitational Programming Contest

    点击打开链接 Happy Reversal Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      J ...

  2. mac svn命令 linux同样适用

    1.将文件checkout到本地目录svn checkout path(path是服务器上的目录)例如:svn checkout svn://192.168.1.1/pro/domain简写:svn ...

  3. appium()-The event firing

    原文地址:https://github.com/appium/java-client/blob/master/docs/The-event_firing.md since 4.1.0 The purp ...

  4. php memcache知识点总结

    $memcache = new Memcache; $memcache->connect('localhost',11211) or die('Could not connect'); //me ...

  5. Appium——WebDriverException: Message: A new session could not be created.

    每次启动完一次脚本再次启动的时候会报这个错误,会话没有被创建 查看了下Appium日志: 查看下设备是否准备好,我用的是模拟器,就cmd下查看下设备: 可以看到设备掉线了... 好吧,重启下设备 脚本 ...

  6. python学习笔记:第二天(基本数据类型)

    Python3 基本数据类型 1.标准数据类型 Python3中有六个标准的数据类型:Number(数字).String(字符串).List(列表).Tuple(元组).Sets(集合).Dictio ...

  7. elasticsearch function_score Query——文档排序结果的最后一道墙

    function_score Query The function_score query is the ultimate tool for taking control of the scoring ...

  8. BZOJ-2257:瓶子和燃料(裴蜀定理)

    jyy就一直想着尽快回地球,可惜他飞船的燃料不够了. 有一天他又去向火星人要燃料,这次火星人答应了,要jyy用飞船上的瓶子来换.jyy的飞船上共有 N个瓶子(1<=N<=1000) ,经过 ...

  9. 「USACO06FEB」「LuoguP2858」奶牛零食Treats for the Cows(区间dp

    题目描述 FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving va ...

  10. js some和filter用法和区别

    some方法 array1.some(callbackfn[, thisArg]) 对数组array1中的每个元素调用回调函数callbackfn,当回调函数返回true或者遍历完所有数组后,some ...