加入收藏 | 设为首页 | 会员中心 | 我要投稿 核心网 (https://www.hxwgxz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程 > 正文

在Phpmyadmin中更改Mysql Server的端口

发布时间:2021-03-16 06:28:25 所属栏目:编程 来源:网络整理
导读:我在我的服务器上运行了两个MySql(5.1.73-1-log)实例,一个在端口3306上(默认),一个在端口3307上.现在,我想更改PhpMyAdmin(3.3.7deb7)以获取第二个实例,在3307,而不是默认的. 因此,我将以下行添加到config.inc.php: $cfg['Servers'][$i]['port'] = '3307';

我在我的服务器上运行了两个MySql(5.1.73-1-log)实例,一个在端口3306上(默认),一个在端口3307上.现在,我想更改PhpMyAdmin(3.3.7deb7)以获取第二个实例,在3307,而不是默认的.
因此,我将以下行添加到config.inc.php:

    $cfg['Servers'][$i]['port'] = '3307';

现在,虽然PhpMyAdmin说localhost:3307(看截图),但它访问的数据库仍然是来自默认端口上运行的实例的数据库.

如何更改设置以使端口更改成为现实?

最佳答案 从PhpMyAdmin documentation …

If you use localhost as the hostname,MySQL ignores this port number and connects with the socket,so if you want to connect to a port different from the default port,use 127.0.0.1 or the real hostname in $cfg['Servers'][$i]['host'].

(编辑:核心网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读