蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 系统管理


    

蓝森林 http://www.lslnet.com 2006年7月28日 15:58

《每日一问》用phpmyadmin连接mysql数据库的问题 (问题已解决)
 
3 个附件
昨天装上httpd+php+mysql
今天想弄一个phpmyadmin来管理数据库
无奈中。无论如何也配置不对,请大侠指点
首先,修改config.inc.php文件的部分内容
引用:
--> $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extension to use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocol for the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settings
// (this user must have read-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables).
// The controluser is also
// used for all relational
// features (pmadb)
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
-->

然后连接http://localhost/phpmyadmin/
出现如下图所示
<img src="http://www.lslnet.com/linux/attachment.php?attachmentid=24092&stc=1"/>

晕倒了。。这是什么密码?
配置文件现在需要绝密的短语密码(blowfish_secret)。
无奈中,再去config.inc.php文件中查找blowfish_secret,找到这一行

$cfg['blowfish_secret'] = '';
随便改了个
$cfg['blowfish_secret'] = '111';
再连接,显示如下
<img src="http://www.lslnet.com/linux/attachment.php?attachmentid=24093&stc=1"/>

输入用户名root密码空(我没设密码)
点登 陆
出现如下画面
<img src="http://www.lslnet.com/linux/attachment.php?attachmentid=24094&stc=1"/>

错误:
#2002 - 服务器没有响应 (or the local MySQL server's socket is not correctly configured)


首先我确定我的mysql服务器是启动了。。
现在应该怎么办,才能正常连接上呀?

还有发贴子的时候怎么在文章中间贴图呀?:)弄了半天,也没弄到文章中间去,呵呵,太糗了


换个版本,我装2.6.1-pl3没遇到过这种问题。另外,新的版本有些功能比较烦,换个老版本试试。

引用:
--> $cfg['blowfish_secret'] = '111';
-->
要是密文这么简单才怪了呢. 肯定有别的工具用来生成密文, 然后再复制到这里, 就像 cvs 那样
到 php 版面问啊

老大好,这个密文到底是啥玩意?

顶一下,沉了

晕,你的版本真奇怪!~我就没有这样的问题

本人问题已自行解决
解决方法如下,给有同样问题的人,少走弯路
引用:
--> $cfg['blowfish_secret'] = '';
-->
的问题,这一行表示的可能是cookie的内容,也就是说如果设置登陆方式为
$cfg['Servers'][$i]['auth_type'] = 'cookie'
的话,就需要在$cfg['blowfish_secret'] = '';
里设置cookie的内容,可以随便打几个东西,啥也行

关于
引用:
--> #2002 - 服务器没有响应 (or the local MySQL server's socket is not correctly configured)
-->
的问题,我换成老版本(2.6.0)后,提示的错误如下
#2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
这样,我就找到了症结所在,肯定跟这个mysql.sock文件有关,在网上搜索了一下,这个好像是文件权限的问题,很多人说改mysql的属性就可以解决,按网上说的更改属性后,问题依旧
看到有一个贴子说把selinux关掉就可以了。。
翻遍我的linux的菜单,终于在系统设置->安全级别里找到这一项,关掉,重启
OK。不再报错了
参考引自
http://www.linuxdw.com/?q=node/110

小结,这种解决办法虽然快,但是隐患太多,那个selinux好像是系统策略之类的东西,如果全关掉,对安全性肯定有影响,虽然我还不知道有什么影响。直觉觉得应该在selinux里设置一下就可以的,但是还没有测试,如果哪位大哥知道,请不吝赐教,让小弟少走弯路!不胜感激

你的目的是设置单个文件的 context?

引用:
--> 你的目的是设置单个文件的 context? -->
这个,,啥叫“单个文件的context”,不懂这是啥意思啊!

[ 关闭窗口 ]


Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com