phpmyadmin 配置文件 config.sample.inc.php 和 config.inc.php

我的操作系统是在XP下用虚拟机模拟Ubuntu 8.04系统,安装好LAMP(包括phpmyadmin),在/usr/share/phpmyadmin目录下有两个配置文件,分别是 config.sample.inc.php 和 config.inc.php,里面的内容也不一样。
如下:
config.inc.php
++++++++++++++++++++++++++++++++++++++++++
<?php
/**
* Please, do not edit this file. The configuration file for Debian
* is located in the /etc/phpmyadmin directory.
*/

// Load secret generated on postinst
include('/var/lib/phpmyadmin/blowfish_secret.inc.php');

// Load autoconf local config
include('/var/lib/phpmyadmin/config.inc.php');

// Load user's local config
include('/etc/phpmyadmin/config.inc.php');

// Set the default server if there is no defined
if (!isset($cfg['Servers'])) {
$cfg['Servers'][1]['host'] = 'localhost';
}

// Set the default values for $cfg['Servers'] entries
for ($i=1; (!empty($cfg['Servers'][$i]['host']) || (isset($cfg['Servers'][$i]['connect_type']) && $cfg['Servers'][$i]['connect_type'] == 'socket')); $i++) {
if (!isset($cfg['Servers'][$i]['auth_type'])) {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (!isset($cfg['Servers'][$i]['host'])) {
$cfg['Servers'][$i]['host'] = 'localhost';
}
if (!isset($cfg['Servers'][$i]['connect_type'])) {
$cfg['Servers'][$i]['connect_type'] = 'tcp';
}
if (!isset($cfg['Servers'][$i]['compress'])) {
$cfg['Servers'][$i]['compress'] = false;
}
if (!isset($cfg['Servers'][$i]['extension'])) {
$cfg['Servers'][$i]['extension'] = 'mysql';
}
}
+++++++++++++++++++++++++++++++++++++++++++++++

config.sample.inc.php的内容如
http://hi.baidu.com/xblogs/blog/item/11ca1f507a3ffb6784352491.html所示
(篇幅有限,抱歉)

请问他们两个是什么关系?哪个才是真正的配置文件?要删除哪一个么?
但是两个文件里面的东西完全没用相似的地方,我怕原来的config文件也是有用的

改任何一个都可以的,试试看就知道了,但是要把config.sample.inc.php改名成你需要的名字
在里面添加上 if (!isset($cfg['Servers'][$i]['host'])) {
$cfg['Servers'][$i]['host'] = 'localhost';
}
if (!isset($cfg['Servers'][$i]['user'])) {
$cfg['Servers'][$i]['host'] = 'root';
}
if (!isset($cfg['Servers'][$i]['password'])) {
$cfg['Servers'][$i]['password'] = '你的数据库密码';
}
只要里面有个这些东西 两个文件都可以用 我以前也有这个问题 我就试了下 然后就发现都是可以的 解决了记得给我加分啊 O(∩_∩)O哈哈~

参考资料:我的经验 :-)

温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-10-23
config.inc.php是config.sample.inc.php的copy版,不需要管config.sample.inc.php,只要修改config.inc.php就行,你的linux版本是帮你配置好的,如果你自己配置就会先copy一下config.inc.php修改成config.inc.php,然后修改config.inc.php文件
第2个回答  2008-10-25
config.inc.php,实在不行的话你就单个改文件名测试嘛。没出错的就是真的。

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网