Delicious Bookmark this on Delicious

Computer Forums

Installing MySQL with an Apache server - Prerequisites


We will assume that you are running an Apache server on a Linux operating system (typically Ubuntu 10, but the procedure can be easily adapted to other Linux distributions). Before proceeding, please make sure that your Apache server functions correctly. If not, you will need to reinstall it using our Apache tutorials.

Installing MySQL with an Apache server - Using the apt-get install Linux command


MySQL can be installed via an RPM package that can be downloaded from the MySQL website. It can also be compiled from source code. Nonetheless, what we choose here is to install MySQL directly from the Linux terminal by running the command:

sudo apt-get install mysql-server mysql-common mysql-client

This will install a MySQL server, a MySQL client and common MySQL libraries on your Linux distribution.

Computer Forums

Installing MySQL with an Apache server - Testing your MySQL server



Once your MySQL server is installed, try connecting to the server by typing the command:

sudo mysql

If everything runs fine, you should be welcomed by the MySQL monitor (after being prompted to enter your Linux root password). In order to see which databases are already created, you can then run the SQL query:

SHOW DATABASES;

MySQL show databases

Computer Forums

Next tutorial: Connectivity between MySQL and Apache


Back to computer forums