现在的位置: 首页 > 综合 > 正文

安装phpMyAdmin

2012年08月15日 ⁄ 综合 ⁄ 共 2561字 ⁄ 字号 评论关闭

1. 到www.phpmyadmin.net的downloads下载phpMyAdmin-3.3.5-all-languages.tar.gz

2. 上传到 /opt/phpMyAdmin/

3. # cd /opt/phpMyAdmin/

4. # tar -xzvf phpMyAdmin-3.3.5-all-languages.tar.gz

5. 拷贝到另一个目录,# cp -r phpMyAdmin-3.3.5-all-languages /usr/share/

修正1:应该在网站根目录下,如home是根目录,那么应该在/home/phpMyAdmin/,以下目录相对应更改.

同时要

ls -l

drwxr-xr-x  11 root root  4096 Aug 11 15:09 phpMyAdmin

6. 重命名phpMyAdmin-3.3.5-all-languages 为phpMyAdmin。

7. 将 /usr/share/phpMyAdmin/libraries/的config.default.php拷贝到/usr/share/phpMyAdmin/目录,重命名为config.inc.php。

8. vim /usr/share/phpMyAdmin/config.inc.php

搜索$cfg['PmaAbsoluteUri'],修改你将上传到空间的phpMyAdmin的网址
如:$cfg['PmaAbsoluteUri'] = ‘http://www.8587.net.cn/phpMyAdmin/’;(这里要有/的)

9. $cfg['Servers'][$i]['host'] = ‘localhost’;填IP地址,如果ip地址不行,就用localhost试试(通常用默认,也有例外,一般都是可以不修改的)

10. $cfg['Servers'][$i]['auth_type'] = ‘config’; 填cookie// Authentication method (config, http or cookie based)
(如果你是在自己的机子里调试那就用config;如果在网络上的空间就用cookie,因为这里我们在前面已经添加了网址,就用cookie好了,也建议大家使用cookie。)

11. $cfg['Servers'][$i]['user'] = ‘root’; // MySQL user(用户名,自己机里用root,在网上一般需要虚拟主机提供商告诉你。)

12. $cfg['Servers'][$i]['password'] = ‘password’; // MySQL password (only needed
(这个是密码,自己机里不用设,留空就可以了,但是虚拟主机里不设置的话……)

13. $cfg['Servers'][$i]['only_db'] = ”; // If set to a db-name, only
(你只有一个数据就设置一下,如果你在本机或想架设服务器,那么建议留空,一般来说是不需要动的)

14. $cfg['DefaultLang'] = ‘en-utf-8’;改为'zh'
(这里是选择语言,zh代表简体中文的意思)

补充说明:
如果按以上操作上传后访问出现“配置文件现在需要绝密的短语密码(blowfish_secret)”
那么请在$cfg['blowfish_secret'] = ‘ ‘;填英文+数字的等号里面设置你网站的cookie,例如:$cfg['blowfish_secret'] = ‘www.8587.net.cn’;
这是因为你的“$cfg['Servers'][$i]['auth_type'] = ‘cookie’的原因。

设置完毕可以上传到网络上的空间了。
补充说明:
如果出现:“没有发现 PHP 的扩展设置mbstring, 而当前系统好像在使用宽字符集。没有 mbstring……” ,那么要重新设置PHP的PHP.ini文件,找到;extension=php_mbstring.dll
去掉前面的分号,同时把在.\php\ext\php_mbstring.dll复制到PHP安装目录,或者把叫系统搜索到PHP\EXT 文件夹。重新启动IIS或APACHE。


 

如果出现如下错误:

Cannot   start   session   without   errors,   please   check   errors   given   in   your   PHP   and/or   webserver   log   file   and   configure   your   PHP   installation   properly.

 

解决办法:

vim /etc/php.ini

查找session.save_path ,

session.save_path = /var/lib/php/session

1.是否被注释,这个是不能被注释的。

2.这个目录的权限设置。网站的User是否对这个目录有访问权限?

# ls -l /var/lib/php/session/

# chmod -R 777 /var/lib/php/session/

 

查找session.auto_start,
将session.auto_start的值改为1(启动),默认是0(禁用)

 修改好后,重启nginx。


 

错误信息:

Wrong permissions on configuration file, should not be world writable!

 

原来phpMyAdmin要在755权限下才能正常工作(777不行)。

cd到phpMyAdmin上级目录,

chmod -R 755 phpMyAdmin


新建远程用户

一般不直接使用root作为远程用户。

GRANT select,update,insert,delete ON *.* TO 'deve' @ '%' ;

flush privileges;

update user set password=password('mypswd') where user = 'apps';

 

select host,user,password from mysql.user;

delete from mysql.user where user='' or host='主机名';

flush privileges;


登录phpmyadmin时候,出现错误

#2013 Cannot log in to the MySQL server

 

将host改为localhost.

抱歉!评论已关闭.