linux 下安装phpMyAdmin

下载phpMyAdmin至/var/www/解压后进入phpMyAdmin目录

安装php-mbstring,让phpmyadmin能够正确识别字符串

[root@centos5 ~]# yum -y install php-mbstring

复制默认配置文件模板到应用配置文件config.inc.php
[root@centos5 ~]# cp /var/www/phpmyadmin/config.default.php /var/www/phpmyadmin/config.inc.php
[root@centos5 ~]# chmod 660 /var/www/phpmyadmin/config.inc.php 改变其属性,使其具有可写性
[root@centos5 ~]# vi /var/www/phpmyadmin/config.inc.php

/**
 * MySQL user
 *
 * @global string $cfg['Servers'][$i]['user']
 */
$cfg['Servers'][$i]['user'] = 'mysql用户';


/**
 * MySQL password (only needed with 'config' auth_type)
 *
 * @global string $cfg['Servers'][$i]['password']
 */
$cfg['Servers'][$i]['password'] = 'mysql密码';           
 

 

$cfg['blowfish_secret'] = ‘在此填入口令’;  (这个口令只是程序内部使用,并非登录相关的口令。口令长度限制在46个字符以内。)
$cfg['Servers'][$i]['auth_type'] = ‘cookie’; (将原先的config改为cookie,使认证方式为cookie方式)

[root@centos5 ~]# chown -R root:apache /var/www/phpmyadmin/

[root@centos5 ~]# vi /etc/httpd/conf.d/phpmyadmin.conf 建立供Apache调用的phpMyAdmin配置文件
Alias /phpmyadmin /var/www/phpmyadmin
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.0

这里只允许本机和192.168.0.0/网段的主机访问,如果允许外网用户,请不要填写标签中的内容

[root@centos5 ~]# /etc/rc.d/init.d/httpd restart 重新启动HTTP服务,使以上设置生效

Stopping httpd: [ OK ]
Starting httpd: [ OK ]

接着就来测试下是否成功了,一开始输入https://192.168.232.128/phpmyadmin

你可能感兴趣的:(linux,职场,phpMyAdmin,休闲)