Table of Contents
The client environment is already present on your computer, otherwise you couldn't use it. You need software for the tiers 2 and 3. In practical terms this means downloading and installing a package. The current recommendation is XAMPP for Windows, MAC and Linux based computers. The A is the web server Apache,, the M is the Database Management System MySQL, and the P is the programming language PHP.
In case you only need the Database Management System you may choose to get MySQL only. In that case you can still follow this guide, just ignore the references to Apache and PHP.
In the opposite case where you don't need the Database Management System you may install the package anyway. In that case you can still follow this guide through the installation. You don't make any of the adaptations for MySQL.
XAMPP may be downloaded from here .
When you are on the download page follow the instructions for download and installation. If you work on Windows, choose installation method A.
Stop all running programs (ie SKYPE) and install. If asked, make sure that you indicate that Apache and/or MySQL are cheked to run as services. It is free in terms of computer resources until you need the services.
Experience show that if you
will do web work with PHP of the installation, you may experience
permissions problems on Windows systems, even
though you have designated yourself an administrator.
My sources say that installing the package directly in C:\
will circumvent those problems.
Start the server from the XAMPP control panel. In the rare case when you are not working with databases, meaning primarily frontend work, you are done with this appendix now. Otherwise we now need to tweak a couple of settings for easier daily use.
Control panel->System->Advanced->Environment vars
Press path and select
Edit
Figure B.2. Path edit
Now add to the end of the line:
;C:\xampp\mysql\bin ind case of installing
XAMPP.
In a MySQL only installation you add
C:\Programs\MySQL\MySQL Server 5.1\bin instead.
If you are unsure of what to write, conduct a search for
mysql.exe. The resulting folder name is what
you must enter at the end of the line.
Start a terminal emulation, I believe the name is
terminal. Then observing cAsE type the following:
echo "PATH=$PATH:/Applications/XAMPP/xamppfiles/bin" >> .bash_profile export PATH >> .bash_profile source .bash_profile
On most linuces, mysql is placed in
/usr/bin thus already on the path. For once
Linux beats the usability of the others.
Start Mysql as root through terminal mode
emulation.
mysql -u root
When you have the terminal window, signified with a
mysql > write as follows to create a user
(press enter at the end of each line), replace xxxx with
your username, and yyyy with your password.
The zzzz being the password you want for the
administrator.
use mysql; delete from user where not host = 'localhost'; grant all privileges on *.* to 'root'@'localhost' identified by 'zzzz' with grant option; grant all privileges on *.* to 'xxxx'@'localhost' identified by 'yyyy' with grant option; grant all privileges on nobody.* to 'nobody'@'localhost' identified by 'test'; flush privileges; exit;
You have now created yourself as a privileged database user
called xxxx with the password yyyy,
and a simple user nobody withe the password
test.
The significance of this is that whoever creates the database,
you, has the full set of privileges to the database. Once
the database is delegated to use by programs, eg on the web,
we want the available access rights to be only as liberal
as the situation demands, not more. For this we grant the
appropriate rights to nobody impersonated
by the programs.
From now on you may use Mysql from the terminal window. When you get the terminal you must write (press enter at the end of each line)
mysql -u xxxx -p yyyy
You may wish to ascertain in your browser that the URI
http://localhost/phpmyadmin will start
phpmyadmin.
Upon installation of the server we need two databases for tests and experiments. They may be downloaded as worldFK.sql, and cms0.sql by right clicking and saving in your personal root dirctory. If you don't know what your personal root is consult your terminal program.
In windows: click Start->write cmd, press enter
the terminal prompt reveals your root folder, something like
C:\Users\<your name>
In OS X on a Mac: Start terminal, again the prompt
tells you something like:
/Users/<your name>
Now, start terminal emulation from your root directory,
and then invoke mysql as follows (enter at the
end of each line):
mysql -u xxxx -p yyyy create database cms0; use cms0; \. cms0.sql commit; select count(*) from page; create database world; use world; \. worldFK.sql commit; select count(*) from country;
Figure B.3. Creation of One of the Databases
This must be entered immediately before you press enter for the input process to start.
Please notice the commit; immediately after the
program reads the data. When that is done you may write the
select-sentence.
If you get the answer 239 from the world database, and the answer 5 from the cms0 database everything is fine. Leave the program with
quit
Quit the terminal window.