6 visitors online
That Aston's back without a bingle

Lara Bingle's stolen $300,000 car has been found in Coogee.

2010-01-01
Read More
Road rage: man fights for life

NSW police say a man has been critically injured in a road-rage incident

2010-01-01
Read More
'Future al-Qaeda plots harder to foil'

Terrorists getting smarter about US defence systems, warns intelligence chief

2010-01-01
Read More
Kokoda Track claims second Australian

A Sydney man is the second Australian to die within a week while attempting the Kokoda Track in PNG.

2009-10-05
Read More
NSW leads way in job ads rise

NSW job ads rise for the third month in a row, providing further evidence that labour market is stabilising.

2009-10-05
Read More
Fifth Australian dies in Samoa

A 30-year-old woman confirmed as fifth Australian to die in tsunami.

2009-10-05
Read More
Australia foils terrorist plot to attack army base

MELBOURNE, Australia – Police in Australia foiled a terrorist plot for commando-style

2009-08-04
Read More
Pulled under car: victim unidentifiable

Woman who died was crossing at lights under green 'walk' signal, police say

2009-08-04
Read More
Thief thanks police for rescuing him

Italian thief was getting a tae-kwondo beating from his Korean victims when police intervened.

2009-08-04
Read More
Cheating husband's genitals glued

Three US women, who had affairs with a married man, accused of revenge plot with wife

2009-08-04
Read More
Hey Hey, iconic TV show might be back

A decade after it was consigned to television's dust bin, Hey Hey It's Saturday looks certain to return.

2009-07-25
Read More
Boffins work on synthetic brain

Research could offer unprecedented insight into the nature of consciousness and our perception of reality.

2009-07-25
Read More
Mobile camera plan to cut road toll

Covert speed cameras seen as a way of lowering the state's worsening road toll.

2009-07-25
Read More
CommBank 'losing war' against fraud

New "phishing" attack asks customers to make call to redeem "cashback bonus".

2009-06-02
Read More

 

Thursday, September 09th 2010

Login Register Panel

Username

Password

Forgot your password

Register

login panel Add To Favourites

Return to Tutorials Index

Small font
Large font

Installing and Configuring MYSQL on Linux and Windows

Database user guide


Installing your database (Linux Users)
To install the phpmyadmin database editor you will first need to download it from http://www.phpmyadmin.net/home_page/downloads.php as a zip file. 

Extract the contents of the file to the root of you website directory.  You will then need to create a config.incl.php file or you may modify the sample one provided config.incl.sample.php by removing the word sample and editing the file.  Add a password to the blowfish secret section and use the username root when you navigate to the file through your browser.
The file provided “xtremecms.sql” is the complete database and is imported as follows;
Navigate to the “phpmyadmin” database control centre by opening your browser and typing in the address bar “Localhost/phpmyadmin”. A login window will appear, please enter the username and password that we have supplied to you.  If you do not know this information then contact your systems administrator for this required information.
Installing your database (Windows Users)
Upon installation of the apache2triad software all the necessary files for the phpmyadmin software will be installed automatically.
Navigate to the “phpmyadmin” database control centre by opening your browser and typing in the address bar “Localhost/phpmyadmin”. A login window will appear, please enter the username and password that you have configured in the config.incl.php.  If you do not know this information then contact your systems administrator for this required information.

Create your database shell


In the section where it says “Create new Database” enter “xtremecms” and click create.  This will create a basic empty database for you to import a pre-saved file which contains the database structure and will open a window similar to diagram 2 below. 

 
Next click the import tab at the top to import the database file.
 
This will open a window with a navigation option for you to import the file “xtremecms.sql”.  Navigate (by clicking “Browse”) to where the file is stored, double click the file and click go, located at the bottom right hand corner of the page.
 
Once you have clicked the “GO” button you will get confirmation of a successful import of the database structure with a window that resembles the one below indicating the “Import has been successfully finished”.

How to add, edit and delete records
Adding a record
To add a record to your database such as a new table, open your browser and enter “Localhost/phpmyadmin” into the address bar and login.  This will open a page like the one below.  On the left hand side select your database “xtremecms” to display the table structure will be displayed on the left hand side of the screen.
 
 
Select your table that you want to add to; in this instance we will select the news table.  This will display the fields that are related to the news table.  At the top of the page click the insert tab.
Diagram 2
 
Once the insert tab is clicked a page will load like the diagram below indicating the fields to enter information.  The news_id is the primary key field and will auto increment (count automatically each time there is an entry) so no entry is required there. 
 
Enter your information as required and click “Go” at the bottom of the page.
Editing a record
To edit a record that is stored on your database, select the table from the menu of tables located on the left hand side of the screen.  In this instance we will use the news table.  This will bring up a screen like the one below.
 
Click the “Browse” tab at the top to open the table and all its contents as pictured below.
 
Select the record for editing by clicking the pen icon   that corresponds with the record for editing.
Clicking this pen icon will open a page like this one below displaying the information that is stored and displayed on the website.
 
Here is where you will edit you record.  Once the record is or has been edited you will click “Go” located at the bottom of the page.  This edited record will automatically appear on the webpage.
 
Deleting a record
To delete a record from your database open “phpmyadmin” and select the table that needs the record deleting from it.  For this instance we will use the news table again.
 
Click the “Browse” tab to open the table as pictured above.
 
Select the record and click the icon   to delete the corresponding record. This action will delete the record and it will no longer appear on the website.
 
Query instructions
To complete a query using phpmyadmin, open your browser and enter the address”localhost/phpmyadmin” into the address bar and hit enter.  Enter your username and password into the spaces provided and click go.  This will open the phpmyadmin page located on your server as shown below.  Please select your database from the drop down list/menu on the left as indicated in the diagram below.

Query Diagrams
 
 
This will display a new window containing all the relevant tables that correspond with this database.  At the top there is a query tab, please select this tab
 
This will display a page much like the one below.  To do a query by users age select the users table first from the left hand side (as indicated) then click update query
 
 
Once submitted you will be given a confirmation screen like the one below indicating where the query is from, how long it took and what it is showing.
 
Responding to error messages
Error messages may appear due to poor configuration of databases and tables as an example.  If you were to add a table and received an error, it may be due to as follows;
 
When creating a table the first field is normally the _id field.  This is or must be set as an integer (INT) from the drop down menu.  Then a numeric value is assigned into the Length/Value field, usually set to 11 for user id.  It is crucial that any id field also be set as unsigned in the attributes, auto-increment in the extra section and finally set as the primary key for the table.  Once these are set then the other values may be set using the other options.

 

To download this complete tutorial complete with screen shots  Click below

Word doc version   PDF version

Written by John Lavis