配置符合个人工作习惯的phpMyAdmin

今天在phpmyadmin官网 下载了phpMyAdmin 3.3.5.1多语言版,是个tar包,传到服务器(linux)上后解压缩。

 

phpMyAdmin的配置文件一般在/usr/share/phpmyadmin/libraries/config.default.php

 

我使用vim来编辑config.default.php ,打开后,会看到用字符拼接而成的DO NOT EDIT形状

 

下面介绍一下配置符合我个人工作习惯的phpMyAdmin的步骤(待配置项用蓝色字表示):

 

1.配置MySql用户名和密码:

 

/**
 * MySQL user用户名
 *
 * @global string $cfg['Servers'][$i]['user']
 */
$cfg['Servers'][$i]['user'] = 'root';

/**
 * MySQL password (only needed with 'config' auth_type)密码
 *
 * @global string $cfg['Servers'][$i]['password']
 */
$cfg['Servers'][$i]['password'] = '';

 

 

2.如果MySQL密码为空,需要这样设置(默认都为false,需要修改一下):

/**
 * whether to allow login of any user without a password
 *
 * @global boolean $cfg['Servers'][$i]['AllowNoPassword']
 */
$cfg['Servers'][$i]['AllowNoPassword'] = true;

 

/**
 * Whether to try to connect without password
 *
 * @global boolean $cfg['Servers'][$i]['nopassword']
 */
$cfg['Servers'][$i]['nopassword'] = true;

 

3.phpMyAdmin有个认证方式,默认为cookie,在这种情况下,会把认证信息写到客户端,清空cookie会登录后一段时间无操作,都会提示重新登录,这样对于频繁操作MySql的我而言很不方便,我需要每次需要时直接打开数据库列表,而不希望看到登录界面,故做如下修改:

/**
 * Authentication method (valid choices: config, http, signon or cookie)
 *
 * @global string $cfg['Servers'][$i]['auth_type']
 */
$cfg['Servers'][$i]['auth_type'] = 'config';

 

改为上述认证方式之前,请先完成步骤1的操作(配置MySql用户名和密码)。

 

4.登录成功后,总会有个提示:配置文件现在需要一个短语密码。

如何去掉上面这行提示呢?做如下修改即可(默认为空,自己随便填写即可):

/**
 * The 'cookie' auth_type uses blowfish algorithm to encrypt the password. If
 * at least one server configuration uses 'cookie' auth_type, enter here a
 * pass phrase that will be used by blowfish. The maximum length seems to be 46
 * characters.
 *
 * @global string $cfg['blowfish_secret']
 */
$cfg['blowfish_secret'] = 'root';

上面这个'root'是我随手写的,你可以改成其他任何字符。

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值