1.下载解压
下载 phpMyAdmin2911.tar.gz 到 /usr/local/src
cd /home/web/
tar -zxvf /usr/local/src/phpMyAdmin2911.tar.gz
ln phpMyAdmin2911.tar.gz phpmyadmin
2.配置:
cd /home/web/phpmyadmin
vi libraries/config.default.php
cd /home/web/phpmyadmin
vi libraries/config.default.php
------------------------------------
$cfg['PmaAbsoluteUri'] = 'http://10.0.0.70/phpmyadmin'; //
$cfg['blowfish_secret'] = '123456';
$cfg['PmaAbsoluteUri'] = 'http://10.0.0.70/phpmyadmin'; //
$cfg['blowfish_secret'] = '123456';
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP addess
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blankfor default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leae blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQLerver ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extensiono use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocolor the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settigs
// (this user must have rea-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/use"
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blankfor default port
$cfg['Servers'][$i]['socket'] = ''; // Path to the socket - leae blank for default socket
$cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQLerver ('tcp' or 'socket')
$cfg['Servers'][$i]['extension'] = 'mysql'; // The php MySQL extensiono use ('mysql' or 'mysqli')
$cfg['Servers'][$i]['compress'] = FALSE; // Use compressed protocolor the MySQL connection
// (requires PHP >= 4.3.0)
$cfg['Servers'][$i]['controluser'] = ''; // MySQL control user settigs
// (this user must have rea-only
$cfg['Servers'][$i]['controlpass'] = ''; // access to the "mysql/use"
$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)
$cfg['Servers'][$i]['nopassword'] = FALSE; // Whether to try to connect without password
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
// this db is displayed in left frame
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
$cfg['Servers'][$i]['nopassword'] = FALSE; // Whether to try to connect without password
$cfg['Servers'][$i]['only_db'] = ''; // If set to a db-name, only
// this db is displayed in left frame
网上以前版本的相关资料
---------------------------------------------------------
config.inc.php
这里是设置访问 phpmyadmin 的 URL 的,如果你将 phpmyadmin 放在站点根目录下,那么应该如下设置:
$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/';
随意输出一个字符串:
$cfg['blowfish_secret'] = 'phpmyadmin';
Server(s) configuration 部分。我们配制这个只有自己用,所以设置一个就可以了,找到并设置如下这几行:
$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address
$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
第一行是设置 MySQL 运行的主机名或 IP ,一般按照默认的即可。
第二行设置 MySQL 的端口,一般也按照默认的即可。
第三行设置登录方式,可以选择三种方式登录,一种是直接根据下面两行输入的用户名和密码登录,一种是 http 方式登录,第三种是 Cookie
方式登录。
如果是本机调试代码,并且别人不会随意修改你的数据库。那么直接使用 config 就行了,在下面输出用户名密码。(首次安装 MySQL 的时候
,默认用户名是 root,密码为空)。
如果选择 http 方式登录,当你通过 URL 访问 PHPMyAdmin 的时候,会弹出一个对话框,正确输入用户名密码后即可登陆。
如果选择 cookie 方式登录,那么访问 PHPMyAdmin 的时候将会有一个登录页面,这里我们选择 cookie 登录方式。设置后如下: