更多内容可移驾至我的独立Blog: http://www.justfbt.com/
Setup 1, install mysql server
# apt-get install mysql-server
Setup 2, config mysql to allow connection mysql server from anywhere
1, # vim /etc/mysql/my.cnf # modify: bind-address
bind-address 0.0.0.0
2, Make sure:
mysql> select host,user from user;
+-------------------+------------------+
| host | user |
+-------------------+------------------+
| % | root |
| 127.0.0.1 | root |
| ::1 | root |
| localhost | debian-sys-maint |
| ser01.example.com | root |
+-------------------+------------------+
5 rows in set (0.00 sec)
commands:
# update user set host = '%' where user = 'root';
Restart mysql server:
# service mysql restart
Setup 3, config phpmyadmin
# wget -l 1024 http://nchc.dl.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.4.3/phpMyAdmin-4.4.3-all-languages.zip
# unzip phpMyAdmin-4.4.3-all-languages.zip
# mv phpMyAdmin-4.4.3-all-languages.zip /usr/share/nginx/html/phpmyadmin
# vim libraries/config.default.php
$cfg['Servers'][$i]['host'] = '192.168.222.71';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'user';
Setup 4, config nginx,php-fpm
# apt-get install -y nginx php5-fpm
# vim /etc/nginx/sites-available/phpmyadmin.conf
server {
root /usr/share/nginx/html/phpmyadmin;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name phpmyadmin.example.com;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite{
rewrite ^/(.+)$ /index.php?$1&;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_keep_conn on;
fastcgi_index index.php;
include fastcgi_params;
}
error_page 404 /404.html;
error_page 500 502 503 504 /500.html;
access_log /var/log/nginx/phpmyadmin-access.log access buffer=64k;
error_log /var/log/nginx/phpmyadmin-error.log error;
}
# ln -s /etc/nginx/sites-available/phpmyadmin.conf /etc/nginx/sites-enabled/
补充:
1, 报错:配置文件现在需要一个短语密码
解决:
1、将 phpMyAdmin/libraries/config.default.php中的
cfg[‘blowfish_secret’] = ”; 改成 $cfg[‘blowfish_secret’] = ‘123456’; (注:其中的’123456′为随意的字符)
2、在phpMyAdmin目录中,打开config.sample.inc.php,18行
cfg[‘blowfish_secret’] = ”; 改成 $cfg[‘blowfish_secret’] = ‘123456’; (注:其中的’123456′为随意的字符)
这个密码用于Cookies的加密,以免多个PhpMyAdmin或者和其他程序共用Cookies时搞混。
做好以上两步,刷新网页,OK,“配置文件现在需要一个短语密码。”的提示不存在了!
2, phpmyadmin页面下方显示:
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. Find out why.
Or alternately go to ‘Operations’ tab of any database to set it up there.
解决:
待续 …
本文详细介绍了如何在服务器上安装并配置MySQL数据库服务器、使用PHPMyAdmin进行数据库管理,以及如何配置Nginx服务器以支持PHPMyAdmin的访问。
2417

被折叠的 条评论
为什么被折叠?



