【问题标题】:phpMyAdmin mysqli::real_connect(): (HY000/2002): Connection refusedphpMyAdmin mysqli::real_connect(): (HY000/2002): 连接被拒绝
【发布时间】:2020-10-20 11:55:56
【问题描述】:

我正在尝试在我的 mac 上设置 phpmyadmin,mysql 已经在我的 mac 上运行,但是我得到了 mysqli::real_connect(): (HY000/2002): Connection denied 错误,任何人都知道如何修复它,谢谢



----------------------------------------------- ---------

config.inc.php 文件:

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 5.0.4 setup script
 * Date: Tue, 20 Oct 2020 11:36:42 +0000
 */

/* Servers configuration */
$i = 0;

/* Server: 127.0.0.1 [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'password';

/* End of servers configuration */

$cfg['blowfish_secret'] = 'C0DH:ogx;5K1W`tteE3T%xL`0TzHYSD~';
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
?>

【问题讨论】:

标签: php mysql phpmyadmin


【解决方案1】:

首先停止 MySQL 并在终端输入:

cd
cd /var
sudo mkdir mysql
sudo chmod 755 mysql
cd mysql
ln -s /tmp/mysql.sock mysql.sock

终于重启 MySQL

【讨论】:

    猜你喜欢
    • 2015-12-31
    • 2020-04-15
    • 1970-01-01
    • 2017-07-12
    • 2021-07-10
    • 2016-03-12
    • 2017-05-04
    • 2020-01-22
    • 2018-10-22
    相关资源
    最近更新 更多