需要密码登录phpmyadmin设置方法
发布:smiling 来源: PHP粉丝网 添加日期:2013-11-29 15:49:43 浏览: 评论:0
一、使用cookie授权模式
找开config.inc.php,将'auth_type'改为'cookie',然后修改'blowfish_secret'用一个任意字符串作为cookie的加密字符串,如果没有加密钥匙,系统会显示"配置文件现在需要绝密的短语密码(blowfish_secret) " ,配置文件如下: $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['blowfish_secret'] = '44e2f5aece2855.93921574'; 修改完毕后,即可出现登录窗口。
二、使用config授权模式
http授权模式的web登陆页面,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:
- <?php
- * 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'] = '';
- ?>
Tags: phpmyadmin 密码登录
相关文章
- ·phpMyAdmin配置安装全攻略(2013-11-13)
- ·phpMyAdmin简明安装教程(2013-11-13)
- ·phpmyadmin 配置方法与安装教程(2013-11-28)
- ·个人空间上安装phpMyAdmin方法(2013-11-29)
- ·phpMyAdmin 缺少 mysqli 扩展,请检查 PHP 配置(2013-12-02)
- ·phpmyadmin不能登录,无任何提示的问题解决(2014-01-06)
- ·解决phpMyAdmin不允许空密码登陆配置方法(2014-06-16)
- ·PHPMYADMIN 无法载入MYSQL扩展,请检查PHP配置(2014-07-22)
- ·浏览器Basic Auth方式认证的phpMyAdmin自动登录(2014-08-26)
- ·Phpmyadmin安装配置方法图解教程(2014-09-10)
- ·phpMyAdmin错误-无法在发生错误时创建会话...(2015-04-09)
- ·centos7下安装配置phpmyadmin教程(2015-04-18)
- ·解决登陆phpMyAdmin出现”#2002 无法登录 MySQL 服务器”方法(2015-12-24)
- ·PHPMyAdmin打开和访问较慢问题解决办法(2015-12-24)
- ·phpMyAdmin正确的安装配置参数详解(2018-06-13)
- ·phpmyadmin PHP 5.3+ is required问题解决办法(2018-10-26)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)