1.先到网上下载phpmyadmin,再解压到可以访问的web目录下(如果是虚拟空间,可以解压后通过ftp等上传到web目录下),当然您可以修改解压后该文件的名称。
2.配置config文件
打开libraries下的config.default.php文件,依次找到下面各项,按照说明配置即可:
a.访问网址
引用:
$cfg['pmaabsoluteuri'] = '';这里填写phpmyadmin的访问网址
b.mysql主机信息
引用:
$cfg['servers'][$i]['host'] = 'localhost'; // mysql hostname or ip address
填写localhost或mysql所在服务器的ip地址,如果mysql和该phpmyadmin在同一服务器,则按默认localhost
$cfg['servers'][$i]['port'] = ''; // mysql port - leave blank for default port
mysql端口,如果是默认3306,保留为空即可
c.mysql用户名和密码
引用:
$cfg['servers'][$i]['user'] = 'root'; // mysql user 访问phpmyadmin使用的mysql用户名
fg['servers'][$i]['password'] = ''; // mysql password (only needed对应上述mysql用户名的密码
d.认证方法
引用:
$cfg['servers'][$i]['auth_type'] = 'cookie';
在此有四种模式可供选择,cookie,http,http,config
config方式即输入phpmyadmin的访问网址即可直接进入,无需输入用户名和密码,是不安全的,不推荐使用。
当该项设置为cookie,http或http时,登录phpmyadmin需要数据用户名和密码进行验证,,具体如下:
php安装模式为apache,可以使用http和cookie;
php安装模式为cgi,可以使用cookie
e.短语密码(blowfish_secret)的设置
引用:
$cfg['blowfish_secret'] = '';
如果认证方法设置为cookie,就需要设置短语密码,置于设置为什么密码,由您自己决定 ,但是不能留空,否则会在登录phpmyadmin时提示错误
好了,到此为止,您已经成功安装了phpmyadmin,简单吧 ,赶快登录体验下吧
说明:
该文档说明的只是安装phpmyadmin的基本配置,关于config.default.php文件中各个配置参数的详细说明可以
phpmyadmin 就是一种 mysql 数据库的管理工具,安装该工具后,即可以通过 web 形式直接管理 mysql 数据,而不需要通过执行系统命令来管理,非常适合对数据库操作命令不熟悉的数据库管理者,下面详细说明该工具的安装方法。
一、下载
1、先到官方站点下载phpmyadmin 安装包:http://www.phpmyadmin.net/ (安装包含各种语言all-languages)
2、再解压到 web 可以访问的目录下,如果是虚拟空间,可以解压后通过 ftp 工具上传到 web 目录下,同时您可以修改解压后该文件的名称(你可以自定义目录名称)。
二、配置
3、打开 /libraries/config.default.php文件(旧版本是根目录下的config.inc.php文件),用写字板(不要用记事本,这是utf8编码)进行编辑,按照说明配置即可。
4、查找 $cfg['pmaabsoluteuri']=‘'; // 修改为你将上传到空间的phpmyadmin的网址
如:$cfg['pmaabsoluteuri'] =‘http: // 网站域名/phpmyadmin/';
5、查找 $cfg['servers'][$i]['host'] =‘localhost'; // 通常用默认,也有例外,可以不用修改
6、查找 $cfg['servers'][$i]['auth_type'] =‘config'; // 在自己的机子里调试用config;如果在网络上的空间用cookie.
在此有四种模式可供选择:cookie,http,http,config
① config 方式即输入phpmyadmin 的访问网址即可直接进入,无需输入用户名和密码,是不安全的,不推荐使用。
② 设置cookie,http,http方式,登录 phpmyadmin 需要数据用户名和密码进行验证。
具体如下:php 安装模式为 apache,可以使用 http 和 cookie;php 安装模式为 cgi,可以使用 cookie。
7、查找 $cfg['servers'][$i]['user'] = ‘root'; // mysql用户名
8、查找 $cfg['servers'][$i]['password'] =''; // mysql 密码 (only needed 留空就可以了)
9、查找 $cfg['servers'][$i]['only_db'] = ''; // 你只有一个数据就设置一下,设置为你的数据库名;如果你想架设服务器,那么建议留空
10、查找 $cfg['defaultlang'] = ‘zh'; // 这里是选择语言,zh代表简体中文的意思
11、查找$cfg['blowfish_secret'] =''; // 如果认证方法设置为cookie,就需要设置短语密码,设置为什么密码,由您自己决定,这里不能留空,否则会在登录 phpmyadmin 时提示如下图所示的错误。
12、设置完毕后保存,现在可以上传到网络空间上了,浏览http://网站域名/phpmyadmin/测试一下。(输入数据库的用户名及密码就可以了)
如果要安装过程中出现:“phpmyadmin - 错误 缺少 mysqli 扩展。请检查 php 配置。”错误。
解决方法如下:
①到phpmyadmin文件夹的librariesconfig.default.php文件中找:$cfg['servers'][$i]['extension']='mysql';语句。
②如果有找到$cfg['servers'][$i]['extension']='mysql';这句,就继续查找下面这句$cfg['servers'][$i]['extension']='mysqli'; 并把其的注释去掉。
③如果没有找到$cfg['servers'][$i]['extension']='mysql';这句,就把$cfg['servers'][$i]['extension']='mysqli';语句,改成$cfg['servers'][$i]['extension']='mysql'; 语句。(即确保 " mysql " 值能生效)
<?php
/* $id: config.inc.php,v 1.204.2.1 2003/10/10 14:24:24 nijel exp $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* phpmyadmin configuration file
*
* all directives are explained in documentation.html
*/
/**
* sets the php error reporting - please do not change this line!
*/
if (!isset($old_error_reporting)) {
error_reporting(e_all);
@ini_set('display_errors', '1');
}
/**
* your phpmyadmin url
*
* complete the variable below with the full url ie
* http://www.your_web.net/path_to_your_phpmyadmin_directory/
*
* it must contain characters that are valid for a url, and the path is
* case sensitive on some web servers, for example unix-based servers.
*
* in most cases you can leave this variable empty, as the correct value
* will be detected automatically. however, we recommend that you do
* test to see that the auto-detection code works in your system. a good
* test is to browse a table, then edit a row and save it. there will be
* an error message if phpmyadmin cannot auto-detect the correct value.
*
* if the auto-detection code does work properly, you can set to true the
* $cfg['pmaabsoluteuri_disablewarning'] variable below.
*/
$cfg['pmaabsoluteuri'] = '';-----这里设置你的phpmyadmin的url,如:http://localhost/phpmyadmin/
/**
* disable the default warning about $cfg['pmaabsoluteuri'] not being set
* you should use this if and only if the pmaabsoluteuri auto-detection
* works perfectly.
*/
$cfg['pmaabsoluteuri_disablewarning'] = false;
/**
* disable the default warning that is displayed on the db details structure page if
* any of the required tables for the relationfeatures could not be found
*/
$cfg['pmanorelation_disablewarning'] = false;
/**
* the 'cookie' auth_type uses blowfish algorithm to encrypt the password. if
* at least one server configuration uses 'cookie' auth_type, enter here a
* passphrase that will be used by blowfish.
$cfg['blowfish_secret'] = '';-----设定好root密码后这里也要填写
/**
* server(s) configuration
*/
$i = 0;
// the $cfg['servers'] array starts with $cfg['servers'][1]. do not use $cfg['servers'][0].
// you can disable a server config entry by setting host to ''.
$i++;
$cfg['servers'][$i]['host'] = 'localhost'; // mysql hostname or ip address----这里可以设定远程mysql服务器ip地址
$cfg['servers'][$i]['port'] = ''; // mysql port - leave blank for default port-----默认为3306
$cfg['servers'][$i]['socket'] = ''; // path to the socket - leave blank for default socket
$cfg['servers'][$i]['connect_type'] = 'tcp'; // how to connect to mysql server ('tcp' or 'socket')-----连接mysql服务器的方式
$cfg['servers'][$i]['compress'] = false; // use compressed protocol for the mysql connection
// (requires php >= 4.3.0)-----是否使用压缩协议,php版本须>= 4.3.0
$cfg['servers'][$i]['controluser'] = ''; // mysql control user settings
// (this user must have read-only
$cfg['servers'][$i]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables)-----mysql控制用户设定,该用户只对mysql数据库下的user和db表有完全权限
$cfg['servers'][$i]['auth_type'] = 'config';
// authentication method (config, http or cookie based)?-----如果php安装模式为apache,可以使用http和cookie;如果php安装模式为cgi,可以使用cookie;默认为config,是不安全的,不推荐。
$cfg['servers'][$i]['user'] = 'root'; // mysql user-----mysql连接用户
$cfg['servers'][$i]['password'] = '';
// mysql password (only needed with 'config' auth_type)-----mysql连接密码,建议在安装好php和mysql后,先用phpmyadmin设定root密码,然后在这里填写
$cfg['servers'][$i]['only_db'] = ''; // if set to a db-name, only
// this db is displayed
// at left frame
// it may also be an array
// of db-names-----如果在这里设定一个数据库的名字,那么登陆后框架左边将只显示这个数据库
$cfg['servers'][$i]['verbose'] = ''; // verbose name for this host - leave blank to show the hostname
$cfg['servers'][$i]['pmadb'] = ''; // database used for relation, bookmark and pdf features
// (see scripts/create_tables.sql)
// - leave blank for no support
// default: 'phpmyadmin'
$cfg['servers'][$i]['bookmarktable'] = ''; // bookmark table
// - leave blank for no bookmark support
// default: 'pma_bookmark'
$cfg['servers'][$i]['relation'] = ''; // table to describe the relation between links (see doc)
// - leave blank for no relation-links support
// default: 'pma_relation'
$cfg['servers'][$i]['table_info'] = ''; // table to describe the display fields
// - leave blank for no display fields support
// default: 'pma_table_info'
$cfg['servers'][$i]['table_coords'] = ''; // table to describe the tables position for the pdf schema
// - leave blank for no pdf schema support
// default: 'pma_table_coords'
$cfg['servers'][$i]['pdf_pages'] = ''; // table to describe pages of relationpdf
// - leave blank if you don't want to use this
// default: 'pma_pdf_pages'
$cfg['servers'][$i]['column_info'] = ''; // table to store column information
// - leave blank for no column comments/mime types
// default: 'pma_column_info'
$cfg['servers'][$i]['history'] = ''; // table to store sql history
// - leave blank for no sql query history
// default: 'pma_history'
$cfg['servers'][$i]['verbose_check'] = true; // set to false if you know that your pma_* tables
// are up to date. this prevents compatibility
// checks and thereby increases performance.
$cfg['servers'][$i]['allowdeny']['order'] // host authentication order, leave blank to not use
= '';
$cfg['servers'][$i]['allowdeny']['rules'] // host authentication rules, leave blank for defaults
= array();
$i++;
$cfg['servers'][$i]['host'] = '';
$cfg['servers'][$i]['port'] = '';
$cfg['servers'][$i]['socket'] = '';
$cfg['servers'][$i]['connect_type'] = 'tcp';
$cfg['servers'][$i]['compress'] = false;
$cfg['servers'][$i]['controluser'] = '';
$cfg['servers'][$i]['controlpass'] = '';
$cfg['servers'][$i]['auth_type'] = 'config';
$cfg['servers'][$i]['user'] = 'root';
$cfg['servers'][$i]['password'] = '';
$cfg['servers'][$i]['only_db'] = '';
$cfg['servers'][$i]['verbose'] = '';
$cfg['servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
$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]['verbose_check'] = true;
$cfg['servers'][$i]['allowdeny']['order']
= '';
$cfg['servers'][$i]['allowdeny']['rules']
= array();
$i++;
$cfg['servers'][$i]['host'] = '';
$cfg['servers'][$i]['port'] = '';
$cfg['servers'][$i]['socket'] = '';
$cfg['servers'][$i]['connect_type'] = 'tcp';
$cfg['servers'][$i]['compress'] = false;
$cfg['servers'][$i]['controluser'] = '';
$cfg['servers'][$i]['controlpass'] = '';
$cfg['servers'][$i]['auth_type'] = 'config';
$cfg['servers'][$i]['user'] = 'root';
$cfg['servers'][$i]['password'] = '';
$cfg['servers'][$i]['only_db'] = '';
$cfg['servers'][$i]['verbose'] = '';
$cfg['servers'][$i]['pmadb'] = ''; // 'phpmyadmin' - see scripts/create_tables.sql
$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]['verbose_check'] = true;
$cfg['servers'][$i]['allowdeny']['order']
= '';
$cfg['servers'][$i]['allowdeny']['rules']
= array();
// if you have more than one server configured, you can set $cfg['serverdefault']
// to any one of them to autoconnect to that server when phpmyadmin is started,
// or set it to 0 to be given a list of servers without logging in
// if you have only one server configured, $cfg['serverdefault'] *must* be
// set to that server.[color]=red]-----是否显示所有的mysql服务器
$cfg['serverdefault'] = 1; // default server (0 = no default server)
$cfg['server'] = '';
unset($cfg['servers'][0]);
/**
* other core phpmyadmin settings
*/
$cfg['obgzip'] = 'auto'; // use gzip output buffering if possible (true|false|'auto')-----有必要的话是否使用gzip输出缓冲
$cfg['persistentconnections'] = false; // use persistent connections to mysql database-----是否使用mysql持久连接,即pconnect
$cfg['exectimelimit'] = 300; // maximum execution time in seconds (0 for no limit)-----最大脚本执行时间,单位:秒
$cfg['skiplockedtables'] = false; // mark used tables, make possible to show
// locked tables (since mysql 3.23.30)
$cfg['showsql'] = true; // show sql queries as run-----运行查询时显示sql查询语句
$cfg['allowuserdropdatabase'] = false; // show a 'drop database' link to normal users-----是否对普通用户显示“删除数据库”连接
$cfg['confirm'] = true; // confirm 'drop table' & 'drop database'-----删除数据表/库前是否出现确认提示框
$cfg['logincookierecall'] = true; // recall previous login in cookie auth. mode or not-----是否收回先前cookie认证模式的cookie
$cfg['usedbsearch'] = true; // whether to enable the "database search" feature
// or not
$cfg['ignoremultisubmiterrors'] = false; // if set to true, pma continues computing multiple-statement queries
// even if one of the queries failed
$cfg['verbosemultisubmit'] = true; // if set to true, pma will show the affected rows of each statement on
// multiple-statement queries. see the read_dump.php file for hardcoded
// defaults on how many queries a statement may contain!
$cfg['allowarbitraryserver'] = false; // allow login to any user entered server in cookie based auth
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!