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 follo 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.
We now need to tweak a couple of settings for easier use along the way.
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.
MySQL irrespective of OS
Start Mysql through terminal mode emulation. When you have the terminal window write as follows:
mysql -u root GRANT ALL PRIVILEGES ON *.* TO 'nobody'@'localhost' IDENTIFIED BY 'test' WITH GRANT OPTION; flush privileges; exit;
You have now created a database user called nobody
with the password test.
Daily use of MySQL
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 nobody -p test use <databasename>
The shown <databasename>
must be substituted with the relevant database name.
You may wish to ascertain in your browser that the URI
http://localhost/phpmyadmin
will start
phpmyadmin.
Upon installation of the server we need a database for tests and experiments. It may be downloaded from my website with a right click of the mouse. When it has been fetched place it in your personal root dirctory.
Start terminal emulation from your root directory,
and then invoke mysql as follows:
mysql -u nobody -p test create database world; use world; \. worldFK.sql commit; select count(*) from country;
Figure B.3. Creation of the database
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 everything is fine. Leave the program with
quit
Quit the terminal window with
exit