我有一个在端口 3307 上本地运行的 mysql 服务器,我可以通过命令行很好地连接到它
mysql -P 3307 -h 127.0.0.1 -u root -p
Run Code Online (Sandbox Code Playgroud)
为了通过 phpmyadmin 访问该数据库,我在 /etc/phpMyAdmin/config.inc.php 中更改了这些设置
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3307';
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试登录时,出现错误“无法登录 mysql 服务器”。这可能是 apache 阻止登录的问题吗?
我尝试使用 localhost/phpMyAdmin 和 127.0.0.1/phpMyAdmin 进行连接。
下面是我的 config.inc.php 文件
<?php
/**
* phpMyAdmin configuration file, you can use it as base for the manual
* configuration. For easier setup you can use "setup/".
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.phpmyadmin.net>.
*/
/*
* This is …Run Code Online (Sandbox Code Playgroud)