If you are a point-and-click kind of person and have to manage one or more MySQL servers, you may find this web-based utility to be a goldmine.
- Local root access on the box or be able to su to root.
- A SSH client such as puTTy or SecureCRT (if you aren’t on the box).
- Your favorite text editor (I prefer nano).
Installation is straight forward. Either download the source from http://www.phpmyadmin.net/ or install it from your favorite package manager. I will be installing it on FreeBSD using the ports tree. If you grabbed the source, just extract it to whichever directory you want it to be accessed from the web. If you install it via ports or packages, it will get installed in /usr/local/www/phpMyAdmin.
# cd /usr/ports/databases/phpmyadmin # make install clean
The configuration of the newer versions (2.7.x and above) can be done by pointing your browser to http://mydomain.com/phpMyAdmin/scripts/setup.php or whatever virtualhost you are using. Now, what we effectively want to accomplish is populating /usr/local/www/phpMyAdmin/config.inc.php with the proper settings that you want. Once you loaded the setup script in your browser, run through all of the setup options configuring what you need. A quick and dirty setup includes adding the server you are connecting to with cookie authentication. Now there are a couple of ways to save this configuration.
Once you click ‘Add’ click ‘Display’ and copy all of the php text, open a ssh connection to your phpMyAdmin server and paste it into /usr/local/www/phpMyAdmin/config.inc.php.
Click ‘Add’ as above, but this time you want to make the config.inc.php file writable by the web server so you can save your configuration from the web interface.
# cd /usr/local/www/phpMyAdmin # chmod g+w config.inc.php
Make your changes in the setup page and then click ‘Save’ to save to the writable config file.
Now point your browser to your phpMyAdmin site and log in using your MySQL credentials. Enjoy.