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
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