一聚教程网:一个值得你收藏的教程网站

热门教程

需要密码登录phpmyadmin设置方法

时间:2022-06-24 23:53:15 编辑:袖梨 来源:一聚教程网

找开config.inc.php教程

一、使用cookie授权模式 将'auth_type'改为'cookie',然后修改'blowfish_secret'用一个任意字符串作为cookie的加密字符串,如果没有加密钥匙,系统会显示"配置文件现在需要绝密的短语密码(blowfish_secret) " ,配置文件如下: $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['blowfish_secret'] = '44e2f5aece2855.93921574'; 修改完毕后,登录窗口入下
4
http授权模式的web登陆页面

二、使用config授权模式
   config需要这几个参数:
$cfg['Servers'][$i]['auth_type'] = 'config';  
//授权模式 $cfg['Servers'][$i]['user'] = 'root';        
//mysql教程登陆用户 $cfg['Servers'][$i]['password'] = '12345';   
//mysql登陆用户密码

将config.inc中,改成
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Authentication method (config, http or cookie based)?
注意,不是http 而是 cookie 哦!!!

三、用http授权模式
$cfg['Servers'][$i]['auth_type'] = 'http';

http授权模式的登陆窗口
注意事项:如果mysql服务器端采用了4.1以上版本,而客户端连接用的是mysql4.1一下版本,对用户设置密码时注意使用OLD_PASSWORD函数,举例:
mysql > SET PASSWORD = OLD_PASSWORD('12345')
mysql > /G
附录:(以下内容是自己写的)除了上述三种phpmyadmin自带的方法外,还可以使用apache的配置来限制登录,在phpmyadmin目录下放置一个.htaccess文件,指定使用的密码记录文 件。然后用htpasswd来生成密码保存在该密码记录文件中(文件的内容是加密的,使用方法htpasswd /etc/php_passwd username)。
    httpd.conf中的内容:phpmyadmin's directory"> AllowOverride AuthConfig
.htaccess文件的内容
authtype basic authuserfile /etc/php_passwd authname information require valid-user
我们可以看到/etc/php_passwd文件中的内容类似这样:
username:2Y2CD6nfJuwL6


更详细的教程

 打开phpMyAdmin中libraries文件找到config.default.php并打开.

  找到$cfg['servers'][$i]['user'] = ' ',在' '中加入'root'

  找到$cfg['servers'][$i]['password'] = ' ',在' '中加入'123456';

  这两个地方的修改就是加入刚才安装的Mysql的用户名和密码,读者可自行修改.

 
这个是配置文件也要修改一下。
config.inc.php

/* $Id: config.sample.inc.php 9689 2006-11-10 20:05:49Z nijel $ */
// vim: expandtab sw=4 ts=4 sts=4:

/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use scripts/setup.php
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki .
*/

/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'afafafaf'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = ''; //用户名
$cfg['Servers'][$i]['controlpass'] = '';//密码
/* Advanced phpMyAdmin features */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma_relation';
// $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
// $cfg['Servers'][$i]['history'] = 'pma_history';
// $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

/*
* End of servers configuration
*/

/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>

热门栏目