修改phpmyadmin中config.inc.php
// Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['auth_type'] = 'cookie';
// MySQL user
$cfg['Servers'][$i]['user'] = 'root';
// MySQL password (only needed with 'config' auth_type)
$cfg['Servers'][$i]['password'] = '';
若将PHP安装为模块方式,则用http,否则用cookie
// Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['auth_type'] = 'cookie';
// MySQL user
$cfg['Servers'][$i]['user'] = 'root';
// MySQL password (only needed with 'config' auth_type)
$cfg['Servers'][$i]['password'] = '';
若将PHP安装为模块方式,则用http,否则用cookie
$cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port
$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfgServers[1]['stduser'] = ''; // MySQL standard user settings (this user must have read-only
$cfgServers[1]['stdpass'] = ''; // access to the "mysql/user" and "mysql/db" tables)
$cfgServers[1]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfgServers[1]['user'] = 'root'; // MySQL user
$cfgServers[1]['password'] = ''; // MySQL password (only needed with 'config' auth)
$cfgServers[1]['only_db'] = ''; 我本地机器访问phpadmin并没有要求输入密码,是不是外界访问会要输入密码。
还有就是如果我把phpmyadmin的目录名字改了是不是要在相关的配置文件里改动相应设置?如apache.
$cfgServers[1]['auth_type'] = 'config';
==>
$cfgServers[1]['auth_type'] = 'cookie';
这样访问phpMyAdmin时就需要身分认证了。你改一下试试先。还有就是如果我把phpmyadmin的目录名字改了是不是要在相关的配置文件里改动相应设置?如apache.
如果你真的要这么做,只用把phpMyAdmin目录下config.inc.php文件中的
$cfg['PmaAbsoluteUri'] 的值改成你新的phpMyAdmin的路径就可以了。
将$cfg['PmaAbsoluteUri']
设成
http://localhost/******如果别人访问你的机器,输入密码后进入,执行任何的操作都会被转到
localhost.....
而localhost顾名思义,你的localhost只有你才能访问。
$cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port
$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfgServers[1]['stduser'] = ''; // MySQL standard user settings (this user must have read-only
$cfgServers[1]['stdpass'] = ''; // access to the "mysql/user" and "mysql/db" tables)
$cfgServers[1]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
$cfgServers[1]['user'] = 'root'; // MySQL user
$cfgServers[1]['password'] = ''; // MySQL password (only needed with 'config' auth)
$cfgServers[1]['only_db'] = ''; 是不是还有什么地方没有设置?