MySQL命令行'-bash命令未找到'

MySQL command line #39;-bash command not found#39;(MySQL命令行-bash命令未找到)
本文介绍了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' 的访问被拒绝

推荐答案

在 mysql/MacBook_Pro" rel="nofollow noreferrer">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命令未找到'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)
SQL/MySQL: split a quantity value into multiple rows by date(SQL/MySQL:按日期将数量值拆分为多行)