无法登录到MySQL服务器(PhpMyAdmin) [英] Cannot log in to the MySQL server (PhpMyAdmin)

查看:498
本文介绍了无法登录到MySQL服务器(PhpMyAdmin)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Homebrew同时安装了MySQL和PhpMyAdmin.当我尝试使用root及其密码登录时,出现以下错误:

I installed both MySQL and PhpMyAdmin via Homebrew. I get the following error when I try to login with root and its password:

Cannot log in to the MySQL server

我可以使用以下命令通过终端登录MySQL:

I can log in to MySQL via the terminal with:

mysql -u root -p

PhpMyAdmin配置:

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'pass';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

我正在 apache 上运行它.我在stackoverflow上尝试了所有解决方案,但它们似乎不起作用.谁能帮我吗?

I'm running this on apache. I tried all the solutions on stackoverflow but they don't seem to work. Can anyone help me?

推荐答案

您可以将localhost127.0.0.1用作主机声明.

You can use both localhost or 127.0.0.1 as host declaration.

根据您的情况,您可以尝试使用localhost,它将起作用.

In your case you can try to use localhost and it will work.

这篇关于无法登录到MySQL服务器(PhpMyAdmin)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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