phpMyAdmin我的邮箱地址::真实的_connect():(HY 000/2002)的规定:连接被拒绝

xjreopfe  于 2022-11-09  发布在  PHP
关注(0)|答案(1)|浏览(128)

I'm tring to set up phpmyadmin on my mac, mysql already running on my mac, but I got mysqli::real_connect(): (HY000/2002): Connection refused error, anyone knows how to fix it, thanks


config.inc.php file:

<?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'] = '';
?>
yftpprvb

yftpprvb1#

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

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

最后重新启动MySQL

相关问题