After install XAMPP

本文介绍如何配置XAMPP中的MySQL和PHPMyAdmin,包括设置管理员账户、密码及权限,修改phpMyAdmin配置文件,安装DBD::mysql模块以支持Perl5等步骤。

1. configure mysql and phpmyadmin

1.1 mysql

$ /Applications/XAMPP/xamppfiles/bin/mysql -uroot
$ mysql > update mysql.user set password = password('somepass') where user = 'root';
# add another account
$ mysql > create user 'admin'@'%' identified by 'somepass';
$ mysql > grant all privileges on *.* to 'admin'@'%' with grant option;
#by default, use admin

1.2 phpmyadmin

  • edit /Applications/XAMPP/xamppfiles/phpMyAdmin/config.inc.php and add account info
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'somepass';
$cfg['Servers'][$i]['hide_db']='^(cdcol|information_schema|mysql|phpmyadmin|performance_schema|webauth|test|raylee_db)$';
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
  • install metro theme for phpmyadmin
    shot of metro theme

2. install DBI support for XMAPP Perl5 (OS X 10.11.3)

$ /Applications/XAMPP/xamppfiles/bin/perl -V
# check the Perl5 version
# is 5.16.3
$ sudo /Applications/XAMPP/xamppfiles/bin/cpan
cpan[1]> install DBD::mysql
# get Error
./dbdimp.h:21:10: fatal error: 'mysql.h' file not found

see here for details

$ sudo /Applications/XAMPP/xamppfiles/bin/perl -MDBD::mysql -e1
# if nothing is displayed, congrats
# OK le

3. configure DocumentRoot

  • default is htdocs/
  • change it to another place : /Users/$USER/WebRoot/html
  • change /cgi-bin/ to /Users/$USER/WebRoot/cgi-bin/

edit xamppfiles/etc/httpd.conf

line 229-230 :
DocumentRoot "/Users/ruili/WebRoot/html"
<Directory "/Users/ruili/WebRoot/html">
line 325 :
<IfModule alias_module>
    # useless comment deleted
    ScriptAlias /cgi-bin/ "/Users/ruili/WebRoot/cgi-bin/"
</IfModule>
line 341:
<Directory "/Users/XAMPP/xamppfiles/cgi-bin">
Options Indexes FollowSymLinks ExecCGI Includes

转载于:https://www.cnblogs.com/raybiolee/p/5679777.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值