因为我们已经安装了mysql-server,建立基本数据库,用户名:root ,密码:9971us,这里我们再安装phpMyAdmin对数据库进行管理。
代码: 全选
# [color=red]export PKG_PATH=ftp://ftp.openbsd/pub/OpenBSD/4.6/packages/i386/[/color]
# [color=red]pkg_add phpMyAdmin[/color]
t1lib-5.1.0p1: complete
jpeg-6bp5: complete
png-1.2.35: complete
php5-gd-5.2.10: complete
php5-mbstring-5.2.10: complete
php5-mcrypt-5.2.10:libltdl-1.5.26: complete
php5-mcrypt-5.2.10:mhash-0.9.9.9: complete
php5-mcrypt-5.2.10:libmcrypt-2.5.8: complete
php5-mcrypt-5.2.10: complete
phpMyAdmin-3.2.0: complete
--- php5-gd-5.2.10 -------------------
You can enable this module by creating a symbolic
link from /var/www/conf/php5.sample/gd.ini to
/var/www/conf/php5/gd.ini.
ln -fs /var/www/conf/php5.sample/gd.ini \
/var/www/conf/php5/gd.ini
--- php5-mbstring-5.2.10 -------------------
You can enable this module by creating a symbolic
link from /var/www/conf/php5.sample/mbstring.ini to
/var/www/conf/php5/mbstring.ini.
ln -fs /var/www/conf/php5.sample/mbstring.ini \
/var/www/conf/php5/mbstring.ini
--- php5-mcrypt-5.2.10 -------------------
You can enable this module by creating a symbolic
link from /var/www/conf/php5.sample/mcrypt.ini to
/var/www/conf/php5/mcrypt.ini.
ln -fs /var/www/conf/php5.sample/mcrypt.ini \
/var/www/conf/php5/mcrypt.ini
--- phpMyAdmin-3.2.0 -------------------
The phpMyAdmin has been installed into /var/www/phpMyAdmin
You should point this to the DocumentRoot of your web-server:
# ln -s ../phpMyAdmin /var/www/htdocs/phpMyAdmin
(make sure you use a relative symlink since Apache is chrooted)
You can ensure you have a working install by accessing:
[url=http://%3Clocalhost%3E/phpMyAdmin/index.php]http://<localhost>/phpMyAdmin/index.php[/URL]
#
代码: 全选
# [color=red]ln -fs /var/www/conf/php5.sample/gd.ini \[/color]
[color=red]> /var/www/conf/php5/gd.ini[/color]
# [color=red]ln -fs /var/www/conf/php5.sample/mbstring.ini \[/color]
[color=red]> /var/www/conf/php5/mbstring.ini[/color]
# [color=red]ln -fs /var/www/conf/php5.sample/mcrypt.ini \[/color]
[color=red]> /var/www/conf/php5/mcrypt.ini[/color]
所以你要:
代码: 全选
# [color=red]ln -s ../phpMyAdmin /var/www/htdocs/phpMyAdmin[/color]
将原内容:
代码: 全选
DirectoryIndex index.html
代码: 全选
DirectoryIndex index.php
代码: 全选
# [color=red]which httpd[/color]
/usr/sbin/httpd
# [color=red]/usr/sbin/httpd stop[/color]
# [color=red]/usr/sbin/httpd start[/color]
看到如下画面:
然后输入我们上面设置的,数据库用户名:root,密码:9971us
OK,进去了
现在已经可以用phpMyAdmin实现一些重要功能了:
1.创建一个MySql数据库
2.创建一个数据库表并添加字段
3.原表中插入新字段
4.导出整个数据库
5.导入数据库
.........
还有一点大家要注意一下,就是OpenBSD中默认安装的php.ini限制的最大导入数据库为2M,你需要修改/var/www/conf/php.ini文件,找到upload_max_filesize, memory_limit 以及post_max_size这些值,然后调整外你需要的参数,我的设置是150M,太大了还是用MySQLAdministrator导入比较保险,总是感觉phpMyAdmin在导入大数据库时容易出现问题。
最后给大家一个学习php的好网站:http://www.php100.com/,里面的教程包含phpMyAdmin的视频教程,教程长度是42分钟,讲得非常详尽了。
[email protected]