Skip to content →

Month: October 2011

Functional dependence in databases: plain language & how-to

Computer scientists speak a language of their own with long ‘noun phrases’ and complex sentences which are often grammatically incorrect or very difficult to parse.

This post here is a short description of FUNCTIONAL DEPENDENCE IN DATA BASES.  This is a common sense view and an AMATEURISH view – so read it to take off the edge off the unintelligibility of explanations around the web but remember that when you want to solve very hard problems, this explanation will probably be not be sufficient or even accurate.

#1 What is a database?

A database is a set of tables.  A table is just a set of rows and columns like we have in Excel.  A database has lots of tables like the sheets in Excel.

And just as we can in Excel, we can tell the program to toddle off to another table to pick up a value, bring it back and put it in another table.  We call that a Look Up.

#2 Looking up something by tracking from table to table

In a complicated set of tables, the value we want might be in Table 6, for example.  We might also have some information that doesn’t allow us to look up what we want in Table 6, but we can use the information we have to look up something in Table 4 and something else in Table 3 and use those two facts to look up what we need in Table 5 and then go to Table 6 to finish the job.

To take a practical example, if you want to look up someone’s telephone number, you need to know their family name and the town where they live.  If their family name is very common, you might need to know their first name and street name as well, but let’s stick to a simple example.

So if we know our friend lives in Timbuktu, we look up the volume number of the directory for Timbuktu, then we go to the Timbuktu directory/table and we use our friend’s name to lookup their telephone number.

Alternatively, the list might have been laid out in one table and we look in the first two columns for Timbuktu AND our friend’s name.  When we have found both together, the correct telephone number will be in the next column.

#3 What is functional dependence?

In plain language, functional dependence just describes how we look up information.

Because we need our friend’s town to look up their telephone number, then telephone number is functionally dependent on town and the computer scientists write that down as Town àTelephone Number.

Equally ,as we need a name to look up a telephone number, telephone number is functionally dependent on name and that is written as Name à Telephone Number.

What’s more, as we need town and name to look up a telephone number, Telephone Number is functionally dependent on Town AND Name. Computer Scientists write that as Town, Name à Telephone Number.

#4 So why do we care about functional dependence?

Every day we ask questions about functional independence without being conscious that we are using this exalted concept!

We use functional dependence every day

Whenever we look up something like a telephone number, we are asking what information we need to know to look up the number.

When you Googled “functional dependence” and landed up here, you used a look up – or rather you trusted Google to know what look-ups to use!

Tough search problems require us to track from one lookup table to another

At work, we might also say, if I have information A and information B, can I find out Z and how do I find out.

How can I step from table to table to get the information that I seek?

When we design a database or set of spreadsheets, we want to do the least work possible!

When we design a database, or set of Excel spreadsheets, we also want to make as few tables as possible!

We want to make sure we only ever have to type a piece of information into only one table once!

We want to make sure that data that hardly ever changes or we hardly ever look at is still accessible but in tables that we can put out of the way.

That’s it.  That’s the what and why of functional dependence.  So let’s turn to the how and specifically the ‘how’ for students.

#5 So how do you work out functional dependence questions?

With the Stanford experiment in online classes going on, and other computer science students doing homework, you might really want to know how do I do these ***** problems?

This is my way – it is not the official way but it works for me.

When I have a table (R) with columns (A, B, C, D etc), I think of the columns as all the columns in a set of spreadsheets.

Then I turn the functional dependencies (FD) (written AàB) into tables.  AàB is a table with two columns, A and B. In plain language, I use column A to look up column B.

Problem 1

Then, when I am asked, does ABCàD work in that relation and set of FD’s, all I do is ask myself, given the set of tables, if I already  know ABC, can I find the value of D? I have to be careful and methodical, but hey it works.

Problem 2

Then when I am asked if BC, say, is a key, I write down BC and I write down the columns that are left – say a, d.  Then I ask if I can look up a and d with B and C.  If I can, then BC is a key. If not, BC is not a key.

Problem 3

When I am asked if two sets of FD are the same, then all I am being asked is whether a set of tables allows me to look up the same information.  This is more tricky and I found it easiest to draw a matrix with a column for each column (A, B, C, D, etc) and a row for each of those columns.  I scratch out the diagonal (A=A) and see if knowing A (row), I can look up B, C, D etc.  This only works for very simple problems though.

So, this is an amateur’s take on functional dependence. Use it if it works for you and not if it doesn’t.  And remember it is an amateur’s version.  Once problems become more complicated, all that maths is probably useful shorthand and my account is probably concealing some misunderstanding or other!

Good luck.

CHECK OUT SIMILAR POSTS

Leave a Comment

12 steps to running gradient descent in Octave

This post provides a birds’ eye view of how to calculate linear regression using the numerical programming used by machine-learning people.  It is, of course, easier to do the linear regression in a statistics program but it is good to know and the overall structure probably provide a foundation for other machine-learning programs.

The algorithm works with Octave which is like a free version of MatLab.

I’ve also only given the birds’eye view because the code is part of the Machine Learning course at Stanford and writing it is part of the homework – if we release it, students’ won’t have to write it themselves and they won’t learn how anything.

Example of linear regression

Imagine you want to buy a second hand car and you collect information on prices for a particularly model with the age and mileage of the vehicle.

The following can compute an equation to predict the price of the car from either the age of the vehicle or the mileage.  Using both age and mileage is a multivariate problem which has different algorithms.

#1 Prepare data

~1 Normally, we would input the data into a table in Excel with the first column being age (or mileage) of the vehicle and the second column being price.

~2 Then we would save the file as a csv (comma separated values) text file which we will call for now mydata.txt

#2 Load the data into Octave

~1 Start Octave from your list of Start/Programs

~2 Tell Octave where your data is stored.  For example, cd ‘c:usersmedata’

~3 Confirm you are in the correct directory by typing ‘pwd’

~4 Read in the data using these three commands

data = csvread(‘mydata.txt’);  % reads the data file

X= data(:,1); % reads all the rows of the first column of the data (age in our example) into matrix X

y = data(:, 2); % reads all the rows of the second column of the data (prices in our example) into vector y

m=length(y); % counts the number of training examples, or rows (age, price pairs in our example)

#3 Visualize the data using plot

~1 Find out what the data looks like (inspect the data) by  using the plot function

~2 This was part of the homework so let’s say that the commands for a plot were put in separate file which is called with a simple command plot(X, y)

~3 Calls to a function can be made from the command line within Octave or another function.

#4 Pick out some data to act as a test you have everything correct

~1 Look at the graph and pick two values of X (age of the vehicle in our example)

~2 Estimate by sight the predicted value of Y (the price of the vehicle in our example)

Hang on to these. You will need them at the end!

 #5 Set the ‘settings’ for the gradient descent

~1 Set the number of iterations and type these in at the command line or put them in another function.  For example, iterations=1500

~2 Set the learning rate.  For example, alpha = 0.01

~3 Set up the matrix of theta values (that is, the y intercept and the gradient of the graph. If price= a +b(age), the two theta values are a and b).  Type in theta= [0;0]. That sets the initial values of both parameters as 0.  A line like this predicts every price as 0 no matter the age of the vehicle.  But it is just our starting point!

#6 Calculate the initial cost function

~1 Calculate the errors in prediction if we treat theta as [0;0], or that is if we treat price as a straight line and always 0.  The formula is in essence the sum of the square of the prediction errors divided by twice the number of cases.  I can’t derive this and I am not going to type it in because finding the right formula was probably part of the homework.

~2 Put the code into a function costCompute (X, y, theta) and save as a text file with extension .m (costCompute.m)

~3 This function is called repeatedly later because every time we improve our guess of the parameters (theta or a & b in the regression line), then our prediction errors will decrease.  Basically, we will stop trying to improve our parameters when we can’t reduce our prediction errors any further.

#7 Repeatedly calculate new parameters

~1 The goal now is to iteratively improve our guesses of the parameters (theta – i.e., a & b in the regression line). The machine learning specialists call this ‘learning’ the parameters.  So, we are starting with [0,0] and we will slowly improve them.

~2  The formulas for changing the parametesr amount to calculating a minute change and taking it away from the last value.

~3 There is a different formula for the two parameters (a & b) largely because they start off as differently – as a  constant, a, and as bx. (It’s maths…)

~4 The constant, a, decreases by the alpha (set as low as 0.01 – see above) times the average error in prediction.  Again the formula is part of the homework so I won’t write it down here.

~5 The slope, b, decreases by the alpha times the average error in the prediction itself multiplied by the original x value.  I vaguely intuit this.  Again there is a formula.

~6  A new cost is calculated with the two new parameters and of course, the cost (think of it as the average prediction error) should have gone down.

#8 Iterate lots!

~1 The iteration in this example was set at 1500!

~2 I don’t see how else the program ended. Presumably it could also be coded to end when the improvement in the cost (improvement in prediction errors) falls below an pre-stated, acceptable level.

#9 Print out a linear fit

~1 Overlay a straight line graph on the original plot of the data

~2 Use Octave’s ‘hold on’ command to keep the old plot as the base

~3 To draw our prediction line, either calculate predicted values or simply calculate the predicted values within the plot command.  Plot (X, X*theta, ‘-‘)

#10 Check the answer is reasonable

~1 Find the test data you set up in step 4.

~2 Calculate predicted values using the parameters we have calculated for the two test levels of X (i.e., what prices do we predict for our two ages of vehicle?).

~3 Do they make sense?  My primary school maths teacher told me ALWAYS to write the answer in plain English!

#11 Visualize theta values in a 3D plot

~1 Use Octave’s surf command to visualize the cost (average prediction errors) of each combination of theta values (a & b).

~2 The 3d plot is bowl-shaped and the best combination of (a & b) is at the putative point where the bowl would balance (my rough understanding).

#12 Visualize the contour plot

~1 Use Octave’s contour command to visualize the theta-theta graph (all those a’s plotted against all those b’s).

~2 Our final version of a and b should sit in the inner circle as if it was the highest point on the contour map of a mountain.

This is my record of the 12 steps in using gradient descent to do linear regression for a problem such as predicting of the price of a car from its age.  We need a large data set of recent data and we repeatedly put in values for the y intercept (value of a car when it is brand new) and the slope (the rate the value decreases). (Yeah, I know… a straight line is not necessarily the best model unless we start after the car is a year old).

The program nippily calculates how bad the model is and when it stops getting better, it stops and delivers the parameters for the line.  We can check the parameters graphically (because like all good data scientists we inspected our data at the beginning).

We can also use the contour and surf functions of Octave to plot the improvements in our estimations so that we can see what the program actually did.

I’ve written this to make sure I can do it again. I hope it is useful but the code itself is embargoed because otherwise future students of Stanford will not have to do any work and will not learn anything!

CHECK OUT SIMILAR POSTS

6 Comments

Install Relational Algebra Interpreter on your Windows machine in less than 30 minutes

This is a quick blog post on how to install and use the Relational Algebra Interpreter on a Windows machine.

#1 What is the Relational Algebra Interpreter?

You only need the Relational Algebra Interpreter if you have a database that you set up through SQLite or MySQL or other database software (not Microsoft Access) and you want a shortcut to writing the SQL commands like SELECT and PROJECT.

The Relational Algebra Interpreter was written Jun Yang, now of Duke Uni.  It is used by many universities, including Stanford, to teach database programming.

#2  Install the Relational Algebra Interpreter?

This notes describe my installation.  I am not an expert and I am jotting down what I did mainly so that I can do it again another day.  If they help you, good; if not, sorry.

#2.1 Do you have Java installed on your machine. I am using Windows 7 on a relatively new machine and I have a Java JRE (runtime environment) installed but not a JDK (development kit).  I didn’t want to rush a notoriously convoluted Java install and make a mess of a new machine, so I fired up my old Windows XP where there is a JDK already installed.

#2.2 Decide where to put your RA interpreter.

The Interpreter comes with everything you need to run on SQLITE databases ( I am not sure on what else) and as I am only using the RA interpreter for a few weeks, I didn’t want to change my PATH statement – so I made a working folder, e.g. C:/A_RA_demo.

I went to Dr Yang’s page and downloaded the RA Interpreter and unzipped it.  I also transferred over from my other machine the test SQLITE3 database that I made earlier (see another post).

#3 Use the Relational Algebra Interpreter

#3.1  The RA Interpreter file runs from your command prompt (Go to Start; type cmd in the box and hit enter; change directory to work in your working directory, e.g., cd c:/A_RA-demo.

#3.2  The RA Interpreter comes with a  sample.db and a sample.properties file.  So to prove everything works, type into your command line, “java –jar ra.jar” and observe the changes on your screen.

#3.3  See what is in the sample.db by typing at the ra> prompt “list;”.

#3.4  Pick any of the “relations” (tables in plain English) and type at the ra> prompt “relationname;”.

#3.5 Type at the ra> prompt “quit;”

#4 Use the Relational Algebra with your own database

#4.1  To use the Relational Algebra with your own database, you must make a corresponding .properties file.

#4.2  Copy the sample.properties file and save it as yourdatabasename.properties.

#4.3  Find the right command line to edit. Most of the file is commentary.

#4.4  I was using a database made in SQLITE3 so I picked the SQLITE command.  You don’t have to add a 3.  You must change the sample.db to the yourdatabasename.extension.  I got held up here for a while because my database was a just a file without an extension.  When I typed in the database-name-only, it worked.

#4.5  Go back to the command line and make sure you are working in the working directory.  If not, look at step #2.2

#4.6 On the command line, type “java –jar ra.jar yourdatabasename.properties”

#4.7 Confirm you have read your database by typing at the >ra prompt “list;”

#4.8  All working?  So quit for now by typing at the >ra prompt “quit;”

#5 Use the Relational Algebra Interpreter with query commands in a file.

#5.1  Put the relational algebra interpreter commands in a text file and save in the working directory (e.g., query1.txt).  [You could test “list;” for now.]

#5.2  Go back to the command prompt and confirm you are in your working directory. Type “java –jar ra.jar yourdatabasename.properties –i query1.txt”

#5.3  You will get an answer, or more likely an error message.  Debug your query, resave query1.txt and rerun the java line.  Conveniently, recall the java line with the up key and enter.

Done!  Now all you have to do is learn the Relational Algebra syntax which you can also find on Professor Yang’s site.  It is a little mind blowing and I found tracking all the brackets quite hard but you get the hang of it with practice.

Make sure you start with a little database so you can check your queries by hand.  And search the Stanford website for class notes to help you on your way.

CHECK OUT SIMILAR POSTS

2 Comments

Build your first SQLITE3 database in Windows in less than 1 hour

Here are some quick & dirty notes on getting SQLITE3 up-and-running on a Windows machine in less than an hour.

#1 Decide where to store SQLITE3 and where you will work

  • I decided to keep a copy of SQLITE3 in a sub-directory of my c:tools directory where I have stored other tools
  • I also decided to put a copy in the directory where I will keep the database. Being able to access SQLITE3 from the data directory saves me some typing later.
  • My data directory is what is sometimes called my desktop.  It is the Windows default setting.  To see the full “path” in Windows, click at the top of the screen where your browser bar usualy is.  C>USER> ….etc turns into the path looking like this C:USERUSERNAMEDocuments…  We’ll cut and paste this path later.

#2  Download SQLITE3

  • The Window binaries for SQLITE3 are here.
  • Download the command shell only.
  • Copy the zip file into both directories: c:toolssqlite and the data directory c:userusernamedocuments… [wherever you will be keeping your database]

#3 Prepare a little file to structure your database

  • As an example copy and paste this code into Wordpad
  • Save the file as “creategobble.sql”
  • Make sure it goes into the directory where you will be working (see above)
  • This file is going to make four tables in the new database.

#4 Go to your command prompt

  • Go to Start and type in “command prompt”.  You should see it come up top right
  • Select Command Prompt
  • Go back briefly to the directory holding your data and copy the path at the top (click on the >Libraries etc and the path will come up C:Users…etc
  • Go back to the Command Prompt and type in cd (for change directory) followed by the path (right click and paste).  Return
  • You will see that you are now working in your data directory

#5 Set up your database

  • Type in “sqlite3 gobble” (gobble is the name of our database)
  • You will see the sqlite come up
  • Type in this line: .read creategobble.sql <return>
  • Hey presto you have a made the little database

#6 Now get some data

  • Open Excel and label four sheets, one for each table : Person, Frequents, Eats, Serves
  • Add data to each table.  Either cut and past the information below, or open this teaching file from Stanford and cut and paste their data.

Person

1 Amy 16 female

2 Bert 20 male

3 Charles 22 male

Frequents

1 Amy PizzaHut

2 Bert Dominos

3 Charles PizzaHut

Eats

1 Amy mushroom

2 Amy cheese

3 Bert cheese

4 Bert seafood

5 Charles cheese

Serves

1 PizzaHut cheese 7.75

2 Dominos cheese 9.75

3 PizzaHut mushroom 8

4 Dominos seafood 11

  • Save each sheet as separate .csv file called persontable.csv, eatstable.csv, etc.

#7 Load your data into your table

  • Go back to your command prompt
  • If you have closed it, then check you are in the right directory.  If not look at #4.
  • Re-open your database “sqlite3 gobble”
  • Tell Sqlite3 that you are uploading .csv files.  Type in “.mode csv” <return>
  • Upload all four files one-by-one: .import persontable.csv person <enter>

#8 Prove to yourself that your data is in the database

  • Type “select * from person;” <return>
  • You should see your data.

There you are. You have made your first database in SQLITE3 and you are ready to play around with it and learn more commands.

CHECK OUT SIMILAR POSTS

Leave a Comment

3 steps to download xmllint

Xmllint is an XML validator. What does that mean?

XML are the codes, or tags, we put around data so we can send it easily from computer to computer.  xmllint audits my tags for errors.

There are three steps to download xmllint onto a Windows machine.

We will get the code from XMLsoft. Looking carefully on their home page, we see that Ivor Zlatkovic has precompiled what we need for Windows.  I didn’t get mine downloaded correctly first time.  So I have prepared an outline to read before we read the more technical notes from Ivor.

Step 1.   Decide where you are going to store your xmllint files

  • I followed Ivor’s suggestion and created a directory in my C: folder called tools.
  • And then I created a sub-directory in C:tools called libxml
  • The complete name of this sub-directory is C:toolslibxml

Step 2.  Download the software for xmllint to run and put it in C:toolslibxml

  • In addition to Ivor’s page at XML soft, these instructions are also worth reading.
  • Basically, you will download 4 zip files (not 3 as the second set of instructions says).  This involves 4 steps.
  • Step One.  Look where Ivor lists the files for the latest win32 versions of libxml2, libxslt, iconv and zlib.
  • Step Two.  Download all four zipfiles. They will go to your default download folder.
  • Step Three.  Open all four zipfiles and look for their bin directory.  In Windows 7, the zipfiles open without using winzip.
  • Step Four.  One-by-one, copy the files in each of the four bin directories into the folder you made earlier: C:toolslibxml

Step 3: Zdjust your Path statement so that if you can work keep this folder neat and work on XML files elsewhere.

  • Basically, you have three steps
  • Step A.  Find your Path statement.
  • Step B.  Edit your Path statement by adding “;C:toolslibxml”
  • Step C.  Save! And Restart your machine.

Instructions for finding your Path Statement.

Check everything is working.

  • Go to your Command Prompt (Go to Start and type in Command Prompt; Look at the top)
  • Type in “xmllint” <return>
  • A whole heap of information about xmllint should scroll down.

Now you can use xmllint to validate XML.

CHECK OUT SIMILAR POSTS

19 Comments

4 reasons why business students should understand XML

I found that Bill Gates gives the simplest explanation of why we should at least have an intuitive understanding of XML.

First a reminder of how the internet and world wide web works

1. The internet is made of networks of networks of computers and computer-like devices like our smart phones.
2. We often (though not always) access information on a computer through webpage on a website.
3. A web page is laid out using HTML. For example, my headings on this page have tags (code) around them that looks like this “<h3>my heading</h3>”.

4. There are two more things we should know about this code. First, the code is not visible to us unless we ask to see it.
5. Second, we put the definition of, that is the size, the colour and the font in another set of code called CSS. The CSS might be at the top or bottom of the web page but is probably in another file.  To link up our webpage to that code, we simply put a line of code (invisible unless we ask to see it) telling the webpage where to find the CSS file and what it is called.

And now to why we need XML

If we only intend people to read a web page, then we only need to lay out our page with HTML (to make it look nice) and have a separate CSS (style) file which defines headings and other formats, like fonts, consistently.
But we often want people to use our data as well.

Example of when we want to tag our data with XML

For example, an airline wants me to read its page (so it should look nice and be consistent).
It also wants travel agents to pick up information about its flights and prices and put up-to-date relevant information into their websites.
XML is used to label the data itself (in addition to labelling is style using HTML tags). So the airlines will tag a departure time as , for example. They will tag an airport name as , perhaps.
By tagging the data, another computer knows immediately that some numbers are a departure time or a name is the name of an airport.

Business people need to understand XML

As Bill Gates puts it, “XML ‘unlocks’ data so that it can be organized, programmed and edited”.
Business managers need to understand XML because the need to understand
1. What data is shared in their industry and what the advantages are of doing so
2. How their data can be structured consistently so computers can work with it
3. Where and how XML tags are added so they can plan workflows and maintain systems efficiently
4. How to check and audit XML (unless they want to be taken to the cleaners)

 
In a later post, I’ll make a simple example of working XML so that you can see what you should be looking out for.

CHECK OUT SIMILAR POSTS

Leave a Comment

Testing my theme

Links break when you move your site from WAMP to your hosting service?

The solution is to set up a parallel Virtual Host on WAMP so that http://mysite.localhost redirects to the default http://localhost/mysite (where mysite is the name of your site).

3 steps to set up a Virtual Host and solve those broken links when you move from WAMP to your hosting service

#1  Get oriented

  • You will only able to see your WAMP based site in your browser after you have turn on your WAMPSERVER by going to Start/All Programs.
  • Look where your files are stored by going into Windows Explorer or My Computer.
    • Look at your C://wamp/ folder
      • You will see c://wamp/www where you store all your websites (right?)
      • And c://wamp/bin/apache/conf/ folder where you see a file called httpd.conf
Leave a Comment

Stop links breaking when you move your site from WAMP to your hosting service

Links break when you move your site from WAMP to your hosting service?

The solution is to set up a parallel Virtual Host on WAMP so that http://mysite.localhost redirects to the default http://localhost/mysite (where mysite is the name of your site).

Three steps to set up a Virtual Host and solve those broken links when you move from WAMP to your hosting service

#1  Get oriented

  • You will only able to see your WAMP based site in your browser after you have turn on your WAMPSERVER by going to Start/All Programs.
  • Look where your files are stored by going into Windows Explorer or My Computer.
  • Look at your C://wamp/ folder
  • You will see c://wamp/www where you store all your websites (right?)
  • And c://wamp/bin/apache/conf/ folder where you see a file called httpd.conf
  • Look at your C://Windows/ folder
  • Track to c://windows/system32/drivers/etc folder where you see a file called hosts
  • Inside the httpd.conf folder, we will list Virtual Server for each (and every) site that we are developing on WAMP for later export to a hosting service
  • That means you should edit this file every time you start work on a new website and clean it this file when you finish work on a website and remove it from your laptop.
  • Inside the hosts file, we are going to tell Windows (as distinct from WAMP) that when it sees a reference to mysite.localhost, it should redirect/loopback to 127.0.0.1 which is the IP address of your computer (and mine when I am working on mine.)
  • Windows 7 will stop you editing this file and we must work around that restriction.
  • Of course, you must do this for every site you are working on and remember to clean off what you no longer need at the end of a job.

#2  Set up your Virtual Server

  • Go to the httpd.conf file and open it in a text editor (Notepad or Wordpad)
  • Look for the line that reads: Servername localhost :80
  • Add the following text below this line.  Substitute your sitename for mysitename and remember to duplicate the last four lines for each website that you are working on

 NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot “c:/wamp/www/”
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot “c:/wamp/www/mysitename”
ServerName mysitename.localhost
ServerAlias mysitename
</VirtualHost>

  • Save as httpd.conf (don’t forget the extension)

#3 Tell Windows to redirect from mysitename.localhost to 127.0.0.1

  • Windows 7 will discourage you from editing the hosts file.  This is your workaround.
  • Go to Start and type in Notepad
  • Right click Notepad and open as Administrator.
  • Track to the hosts file (see #1) and open the file.  You may have to change the setting from Textfiles to All Files.
  • Look at the last line. It probably reads 127.0.0.1 localhost.
  • Add another line reading 127.0.0.1 mysitename.localhost
  • Close and save

Check you are redirecting your site successfully

  • Confirm nothing is broken
  • Go back to WAMPSERVER (look for the W, bottom right on the task bar)
  • Select localhost
  • Open your website and others too
  • Close the other tabs so there is no confusion
  • Enter the link above.
  • Everything still working?
  • Prove your redirect works
  • Shut all the tabs
  • Does your site open correctly?

 

Set up links that don’t break when you export your site

Now you can set up all your links without them breaking when you move your site.  Hmm. . . not sure this is the last word here.  I suspect the format is important.

 

CHECKOUT SIMILAR POSTS

Leave a Comment

5 minute install of DRUPAL on WAMP

Install Drupal with WAMP

Situation: To develop DRUPAL on my laptop

I want to download DRUPAL onto my laptop so that I can develop DRUPAL websites on my laptop before I load them up to my hosted server accessible by the public.

I already develop WordPress and Wikis on my laptop and with a local server WAMP.  I got the instructions to download WAMP from Lifehacker.

Mission: A 5 minute install of DRUPAL on WAMP

I want to download Drupal and set it up successfully.

Execution:  Critical steps for downloading DRUPAL quickly and successfully first time

#1  Check my directory structures

  • C:WAMP
  • C:wampbinapached
  • C:wampwww. . . .[all my development sites]

#2  Make  a directory to receive DRUPAL

  • C:WAMPwwwmynewsite

#3  Start WAMPSERVER

  • Go to Start/All Programs
  • Active WAMPSERVER (my installation asks me to confirm permission)
  • Look for icon in the bottom right of the task bar (W)
  • Check options ( localhost, phpMyAdmin, PHP which includes php.ini)
  • Go to localhost and see the folder you create “mynewsite” (though there is nothing in it yet)

#4  Set up my new SQL database

  • Go back to the WAMPSERVER menu (W) and select phpMyAdmin
  • Look in the middle of the page for Create database
  • Insert the name of the database.  I usually use the name of the website. Hit Create
  • Check your privileges.  If you set up your WAMPSERVER using the instructions from Lifehacker, then you will have two root users and yourself and all three users have global privileges.  Note your username (!) and recall your password.  You will need them shortly.

#5  Download Drupal and unzip it into your folder : c:wampwwwmynewsite (or whatever you called it)

#6  Install Drupal

  • Go back to the WAMPSERVER menu ( W on taskbar bottom right)
  • Select localhost
  • Select “mynewsite” (or whatever you called it)
  • You should be looking at the Drupal installation screen.

#7 Activate the DRUPAL installation programme

  • Select standard install
  • In English (assuming that is your preference)
  • Leave the selection as SQL
  • Insert the name of your database
  • Insert your username (see step 4 above)
  • Insert your password
  • Let DRUPAL do its thing

#8  Now do as DRUPAL asks and put in the email address, admin name and password for the website

  • NB These are not the same as the database in steps 4 and 7.

#9  Go to configuration

  • Make sure “clean urls” (pretty permalinks) is ticked.

Confirmation

I now have a working DRUPAL website accessible through my WAMPSERVER/local host or through my browser http://localhost /mynewsite and in under 5 minutes.

It’s ready for tweaking and development prior to being loaded up to a hosting service for public use.

CHECK OUT SIMILAR WEBSITES

2 Comments