MySQL命令行'-bash找不到命令“ [英] MySQL command line '-bash command not found'

查看:1714
本文介绍了MySQL命令行'-bash找不到命令“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在帖子的末尾下面的链接是有益的,但​​有人可以澄清这一点。
有2个答案是完全冲突的,所以我问一下吧。

The following link at the end of the post was helpful but can someone clarify this. There are 2 answers that are in complete conflict so I am asking about it.

一个人回应,你应该得到这样的MySQL命令行
导航到目录

One person responds that you should get to the MySQL command line like this Navigate to the directory

/usr/local/mysql/bin

和在UNIX提示符下键入:

And and at unix prompt type:

Macbookpro$./mysql

然后键入以下命令重置密码。

Then type the following to reset the password.

mysql -u root -p

但随后另一个人说:

But then another person says:

不,你应该运行在bash的mysql -u根-p,而不是在MySQL命令行。如果你是在MySQL中,你可以键入exit退出。

"No, you should run mysql -u root -p in bash, not at the MySQL command-line. If you are in mysql, you can exit by typing exit."

无论这些工作我。
第一种方法从bash提示符:

Neither of these work for me. First method From the bash prompt:

$macbookpro mysql -u root -p
Enter password:  xxxx
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

从MySQL方法二>提示

Second method from mysql> prompt

mysql> -u root -p
    ->

我也经常得到这个错误:
-bash找不到命令

I also often get this error: -bash command not found

我无法登录到phpMyAdmin。
谢谢你。

I am unable to login to phpMyAdmin. Thanks.

我的问题是尝试登录到phpMyAdmin当我收到此错误信息。
没有密码登录被禁止的配置

My problem is that I am getting this error message when trying to login to phpMyAdmin. "Login without a password is forbidden by configuration"

在上面所引用的链接。从2013年开始回应

The link that in have referenced above. Responses from 2013

<一个href=\"http://stackoverflow.com/questions/8838777/error-1044-42000-access-denied-for-user-localhost-to-database-db\">ERROR 1044(42000):拒绝访问用户''@'localhost'的数据库DB

推荐答案

要使用命令即的MacBook终端上的mysql $需要使用导出路径:

To use command i.e. $mysql on macbook terminal you need to export path using:

export PATH=$PATH:/usr/local/mysql/bin/

考虑默认安装使用下面的命令来获得MySQL提示以根用户身份:

considering default installation use following command to get mysql prompt as root user:

mysql -u root

否则你正在使用错误的root密码。

otherwise you are using wrong root password.

参考:<一href=\"http://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-osx\">Setting在OSX MySQL root用户密码

Ref: Setting the MySQL root user password on OSX

这篇关于MySQL命令行'-bash找不到命令“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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