在OS X 10.7中找不到Mysql命令 [英] Mysql command not found in OS X 10.7

查看:71
本文介绍了在OS X 10.7中找不到Mysql命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在os x 10.7上启动mysql.它位于/usr/local/mysql/bin/mysql

I cant get my mysql to start on os x 10.7. It is located in /usr/local/mysql/bin/mysql

在终端中键入mysql --version时,找不到命令.

I get command not found when I type mysql --version in the terminal.

我尝试过无法从命令行mac访问mysql ,但仍然找不到命令.我尝试使用dmg安装mysql,并且尝试通过自制软件安装它,但我无法使其正常工作.当我尝试使用自制软件启动mysql时,我得到 MySQL无法启动

I tried this can't access mysql from command line mac but still get command not found. I tried installing mysql with the dmg and i have tried to install it through homebrew and I cant get it to work. When I try to start mysql with homebrew I get MySQL won't start

这是我的$PATH:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/Victoria/bin:/usr/local//usr/local/mysql/bin/private/var/mysql/private/var/mysql/bin

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/Users/Victoria/bin:/usr/local//usr/local/mysql/bin/private/var/mysql/private/var/mysql/bin

推荐答案

这是您的$ PATH的问题:

This is the problem with your $PATH:

/usr/local//usr/local/mysql/bin/private/var/mysql/private/var/mysql/bin.

$PATH是外壳程序在其中搜索命令文件的位置.要搜索的文件夹需要用冒号分隔.因此,您想在路径中使用/usr/local/mysql/bin/,但改为在/usr/local//usr/local/mysql/bin/private/var/mysql/private/var/mysql/bin中搜索,该目录可能不存在.

$PATH is where the shell searches for command files. Folders to search in need to be separated with a colon. And so you want /usr/local/mysql/bin/ in your path but instead it searches in /usr/local//usr/local/mysql/bin/private/var/mysql/private/var/mysql/bin, which probably doesn't exist.

相反,您需要${PATH}:/usr/local/mysql/bin.

export PATH=${PATH}:/usr/local/mysql/bin也是.

如果希望每次打开终端时都运行此命令,请将其放入文件.bash_profile中,该文件在终端打开时运行.

If you want this to be run every time you open terminal put it in the file .bash_profile, which is run when Terminal opens.

这篇关于在OS X 10.7中找不到Mysql命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆