Apache, PHP, MySQL, and Drupal in FreeBSD 10 – Part II: MySQL55 and phpMyAdmin

Managing MySQL55 with phpMyAdmin:

In Part 1 of this article, Apache24 Server and PHP5 were installed and configured.  The next step towards having a functional FAMP (FreeBSD, Apache, MySQL, PHP) Stack is to install mysql and phpmyadmin.

 

MySQL55:

# cd /usr/ports/databases/mysql55-server
# make install clean

 

After installation perform the following:

# echo 'mysql_enable'="YES" >> /etc/rc.conf
# /usr/local/etc/rc.d/mysql-server start
# /usr/local/bin/mysqladmin -u root password 'your-password-here'

 

Note:  In the future, if you are required to upgrade the current version to the next release, the following must be performed:

# mysql_upgrade -u root -p

 

phpMyAdmin:

# cd /usr/ports/databases/phpmyadmin
# make install clean

 

Before configuring phpMyAdmin, the Apache24 config file httpd.conf file needs editing:

Add the following lines to the very bottom of /usr/local/etc/apache24/httpd.conf file:

 

Alias /phpmyadmin "/usr/local/www/phpMyAdmin"
<Directory "/usr/local/www/phpMyAdmin">
             Options None
             AllowOverride None
             Require all granted
</Directory>

 

As good measure, restart apache:

# apachectl restart

 

Next, start configuring phpMyAdmin:

# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
# mkdir /usr/local/www/phpMyAdmin/config
# chmod 757 /usr/local/www/phpMyAdmin/config
# chmod 644 /usr/local/www/phpMyAdmin/config.inc.php

 

Start your web browser and direct it towards:

http://your-web-site-ip/phpmyadmin/setup/

 

Next, following these steps:

  • Select New Server, then select the Authentication Tab
  • Under Authentication Tab, choose “cookie” and remove “root” from the “User for config auth”
  • Apply and save

 

After a successful login, let’s perform some clean up:

# mv /usr/local/www/phpMyAdmin/config/config.inc.php /usr/local/www/phpMyAdmin
# rm -r /usr/local/www/phpMyAdmin/config
# chmod 600 /usr/local/www/phpMyAdmin/config.inc.php
# apachectl restart
# /usr/local/etc/rc.d/mysql-server restart

 

Open your browser and go to the following:  http://your-web-site/phpmyadmin/ and login as “root” 

 

Summary:

Installing and configuring mysql and phpMyAdmin is not tough, however, it can be tedious.  Part III of this article will focus on the final part of our FAMP Stack – Drupal 7.  As always, if you see any errors or areas of need of clarification, please send in your comments.

 

Additional Resources:

http://www.mysql.com

http://phpmyadmin.net

Leave a Reply

Your email address will not be published. Required fields are marked *