cmd进入mysql 光标不见了_MySQL命令行'-bash找不到命令“

博主在尝试通过cmd进入MySQL时遇到光标消失和命令找不到的问题。尝试了两种方法:直接在bash中输入`mysql -u root -p`以及在MySQL命令行中使用`-u root -p`,但都失败了。第一种方法出现权限错误,第二种方法导致-bash命令未找到。同时,登录phpMyAdmin时也收到密码配置错误的提示。解决方案是通过在终端中添加路径`export PATH=$PATH:/usr/local/mysql/bin/`,然后使用`mysql -u root`命令。
摘要由CSDN通过智能技术生成

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.

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

Navigate to the directory

/usr/local/mysql/bin

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:

"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."

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)

Second method from mysql> prompt

mysql> -u root -p

->

I also often get this error:

-bash command not found

I am unable to login to phpMyAdmin.

Thanks.

My problem is that I am getting this error message when trying to login to phpMyAdmin.

"Login without a password is forbidden by configuration"

The link that in have referenced above. Responses from 2013

解决方案

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

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

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

mysql -u root

otherwise you are using wrong root password.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值