phpmyadmin - 无法连接:无效设置 [英] phpmyadmin - Cannot connect: invalid settings

查看:93
本文介绍了phpmyadmin - 无法连接:无效设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我几个小时以来一直在挣扎,这就是设置:

I am struggling it since hours, this is how the setup is:

  1. 我在 PC 上安装了 XAMPP 堆栈.在c:/program files/MySQL/MySQL Server 5.0下已经有安装MySQL的软件了.如果我去 services.msc 可以看到两个 MySQL 服务自动运行mysql"和MySQLxxxx"(xxxx 是软件名称).

  1. I installed XAMPP stack on a PC. It already had a software which installed MySQL under c:/program files/MySQL/MySQL Server 5.0. If I go to services.msc I can see two MySQL services running automatically "mysql" and "MySQLxxxx" (xxxx is name of the software).

最初没有通过控制面板运行 MySQL 服务.我在 my.ini 中将其端口更改为 3307(因为程序文件/mysql 中的 my.ini 将端口设置为 3306)和服务和端口设置"​​.它现在在 XAMPP 控制面板中运行.

Initially MySQL service wasn't running via control panel. I changed its port to 3307 in my.ini (as my.ini in program files/mysql had port set to 3306) and "service and port settings". It runs now in XAMPP control panel.

错误MySQL 说: 文档无法连接:无效设置.phpMyAdmin 尝试连接 MySQL 服务器,服务器拒绝连接.您应该检查配置中的主机、用户名和密码,并确保它们与 MySQL 服务器管理员提供的信息相对应.

Error MySQL said: Documentation Cannot connect: invalid settings. phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

==================

=================

我错过了什么?如何解决这个问题?

What am I missing? How to resolve this issue?

Edit1:添加额外信息

Added extra information

Edit2:我将 $cfg['Servers'][$i]['auth_type'](在 config.inc.php 中)从 config 更改为 http,现在它提示输入用户名/密码,但当我输入它们(root"和密码")时,它不接受它们.

I changed $cfg['Servers'][$i]['auth_type'] (in config.inc.php) from config to http, now it prompts for username/password but when I enter them ('root' and 'password') it doesn't accept them.

推荐答案

既然你改变了 MySQL 使用的端口,你必须告诉 phpMyAdmin——以及你所有的其他应用——关于这个变化.

Since you've changed the port MySQL is using, you have to tell phpMyAdmin -- and all your other applications -- about this change.

对于 phpMyAdmin,编辑或添加一行,如 $cfg['Servers'][$i]['port'] = '3007';

For phpMyAdmin, edit or add a line like $cfg['Servers'][$i]['port'] = '3007';

由于您正在运行两个 MySQL 实例,因此您可以从 phpMyAdmin 连接到这两个实例;改编自来自维基:

Since you're running two MySQL instances, you can connect to both from phpMyAdmin; adapted from the wiki:

<?php 
$cfg['blowfish_secret']='0987654321'; //any string of your choice (max. 46 characters)
$i = 0;  

$i++; // server 1 
$cfg['Servers'][$i]['verbose']   = 'Production server'; 

$i++; // server 2
$cfg['Servers'][$i]['port'] = '3007';
$cfg['Servers'][$i]['verbose']   = 'Development server'; 

顺便说一下,我更喜欢 auth_type 'cookie' 有几个原因;如果连接时出现问题,它可以提供更好的错误报告,它可以更轻松地在用户和服务器之间切换,而且我不喜欢我的浏览器为 http 基本身份验证提供的模式对话框.当然,您可以随意使用.

By the way, I prefer the auth_type 'cookie' for a few reasons; it can give better error reporting if something goes wrong when connecting, it makes it easier to switch between users and servers, and I dislike the modal dialog my browser presents for http basic authentication. Of course, you're welcome to use whatever you prefer.

这篇关于phpmyadmin - 无法连接:无效设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆