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

查看:58
本文介绍了无法登录 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天全站免登陆