Friday, June 20, 2008

server admin: managing your database using phpMyAdmin

phpMyAdmin is an open source tool for managing the MySQL database management system. It consists of a web interface implemented in PHP that allows database administrators to interface directly with their MySQL database without using the command line.

This blog entry will actually just outline the steps on installing and configuring phpMyAdmin and configuring the MySQL database to enable access from phpMyAdmin:

1. If you haven't done already, download the phpMyAdmin installation package from www.phpmyadmin.net. Be sure to select the latest stable version.

2. Extract the files to a "phpmyadmin" folder in the DocumentRoot of your Apache installation or in any folder inside document root where you want to access phpMyAdmin. For my case, I extracted the files in "C:\www" since this is where I set my Apache DocumentRoot. If you don't have any idea where your DocumentRoot is, check your httpd.conf Apache configuration file.

3. Open
your browser and in the address bar type "http://localhost/phpmyadmin/index.php", or if you extracted in a different location, use that location.

4.
If PHP was installed correctly, you should see the phpMyAdmin login page, BUT with an error.

5. To fix this error open the file "
config.inc.php" in your phpmyadmin directory and edit the following lines with the correct information:

$cfg['blowfish_secret'] = ' '; // you can put any word here
$cfg['Servers'][$i]['host'] = ' '; // you would usually want to put "localhost" here

6. You'd also want to add extension files to PHP since phpMyAdmin would be looking for them. I don't have an idea yet what each extension does, but better to include them to remove the warnings issued by the phpMyAdmin interface:

extension=php_mbstring.dll
extension=php_mysqli.dll
extension=php_mcrypt.dll // you also need to put a copy of libmcrypt.dll in "C:\WINDOWS\System32" for this extension to work

7. After doing this, you should be able to see the following web interface:


--fin

Up next, in this server administration series:

using the MySQL command line client (for CIE 122)
implementing a file upload system (for my CE 21 class)
installing apache, mysql and php in linux
installing Joomla!
installing the wordpress engine to your server
installing tWiki into your server
installing an ftp server
installing a mail server
enabling ruby on rails on your WAMP or LAMP server

No comments: