Setting up mysql and phpmyadmin on Mac OSX

well, I have been using MAMP for quite a long time. It’s a nice app. But then again, if I have native support on my own OS why use an third party app. Heh, actually I need this for some other reason.

Anyway, I am using Snow Leopard (little old though, don’t have money to buy the new one :P)

So, first download the latest version of .dmg from here.

Click mysql-5.5.19-osx10.6-x86_64.pkg (you may have different version) and install by following the screen.

Though this is optional, but I recommend to install MySQLStartupItem.pkg and run the MYSQL.prefPane as well. It will give you a MySQL panel on the System Preference. From here you can start/stop MySQL and also set for automated start upon server startup.

MySQL is accessible from /usr/local/mysql/bin/mysql

Set MySQL password for later use.

/usr/local/mysql/bin/mysqladmin -u root password SECRET

Installing phpmyadmin

Start Apache from System Preference (enable the web sharing). http://localhost should work now.

In Mac OSX PHP is not enabled by default. So enable PHP from /etc/apache2/httpd.conf by uncommenting the LoadModule php5_module        libexec/apache2/libphp5.so line.

Download phpmyadmin from here.

Extract the files into /usr/local/ directory and rename it to phpmyadmin

Copy the config.sample.inc.php and rename it to config.inc.php from the phpmyadmin directory.

Create a file into /etc/apache2/other/ and add the following lines

Alias /phpmyadmin /usr/local/phpmyadmin
<Directory /usr/local/phpmyadmin>
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

Restart Apache from terminal

apachectl restart

Open http://localhost/phpmyadmin/

tada!!!!

Advertisements

Install phpmyadmin in ubuntu

In the previous article you’ve seen how to setup a LAMP server. Now if you want to install phpmyadmin open your terminal and type
sudo apt-get install phpmyadmin
follow the screen.

Now, open browser go to http://localhost/phpmyadmin/

you are done with your phpmyadmin installation. now, login with the password you provided earlier.