MAMP and phpMyAdmin at Mac

Apache and PHP are included by default in Mac OS.

Enable Apache on Mac OS X:
sudo apachectl start

Apache htdoc at Mac OS:
/Library/WebServer/Document
REMEMBER to change the permission of this folder in Finder.
Let apache own the permission:
sudo chown -R _www /Library/WebServer/Documents/wedance

Enable PHP for Apache:
sudo vim /etc/apache2/httpd.conf
Uncomment the following line (remove #):
LoadModule php5_module libexec/apache2/libphp5.so

Restart apache:
sudo apachectl restart

Install MySQL: The DMG Archive.
http://dev.mysql.com/downloads/mysql/
Open System Preferences -> MySQL -> Ensure the MySQL Server is running.

cd /usr/local/mysql/bin
This program enables you to improve the security of your MySQL installation:
mysql_secure_installation

To get started, log into MySQL’s root (administrative) account by issuing this command:
mysql -u root -p
Exit: exit

If failed, try:
mysql -u root -p --connect-expired-password
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mySuperSecretPassword');

Download phpMyAdmin: https://www.phpmyadmin.net/downloads/
cp config.sample.inc.php config.inc.php
$cfg['Servers'][$i]['host'] = '127.0.0.1';

发表评论