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

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

问题描述

帖子末尾的以下链接很有帮助,但有人可以澄清一下吗?有两个答案完全冲突,所以我在问.

The following link at the end of the post was helpful, but can someone clarify this? There are two 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.

导航到目录

/usr/local/mysql/bin

在 Unix 提示符下,键入:

And at a Unix prompt, type:

./mysql

然后键入以下内容以重置密码.

Then type the following to reset the password.

mysql -u root -p

然后另一个人说:

不,您应该在 bash 中运行 mysql -u root -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 提示符:

First method. From the Bash prompt:

mysql -u root -p

Enter password:  xxxx
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

来自 mysql> 提示的第二种方法:

Second method from the mysql> prompt:

mysql> -u root -p
    ->

我也经常收到这个错误:

I also often get this error:

-bash 命令未找到

-bash command not found

我无法登录 phpMyAdmin.

我的问题是我在尝试登录 phpMyAdmin 时收到此错误消息:

My problem is that I am getting this error message when trying to log in to phpMyAdmin:

配置禁止无密码登录

上面引用了我的链接.2013 年的回复:

The link that I have is referenced above. Responses from 2013:

错误 1044 (42000): 用户 ''@'localhost' 对数据库 'db' 的访问被拒绝

推荐答案

MacBook 终端,需要导出路径使用:

To use the command, i.e., mysql on a MacBook terminal, you need to export the path using:

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

考虑默认安装,使用以下命令以root用户身份获取mysql提示:

Considering the default installation, use the following command to get the mysql prompt as the root user:

mysql -u root

否则您将使用错误的 root 密码.

Otherwise you are using the wrong root password.

参考:在操作系统上设置 MySQL root 用户密码X

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

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