By: Vlad Vistac
Submitted: 2010-07-21 20:04:30 | Word Count: 510
What is MySQL?
Databases have been the backbone of many successful sites. Goole, Faebook, Wikipedia, Wordpress sites and many bussiness sites use MySQL to create databases and use the data on ther web sittes.
[ advertisement ]
Who Invened MySQL?
Ulf Michael Widenius, from Finland was the developer of MySQL and named the program afgter his daughter, My. It was released for the frst time in 1996. Sun Microsystenms purchased it on February 26, 2008, mazking Ulf Michael Widenius, one of the top ten money earners in iFnland.
How To Create A Database
To underrstand how to use these tools to make your website better, you'll need to know how to crete an Excel spreadsheet file. Since Exel is so wdiely used, you are preobably familiar with usnig it. You can easily see that information is basically stored in columns and rows.
Imagine that you had a physical store that sold colored balls in a variety of colors and sizes made in a variety of materials and sold at differet prics. You cuold cerate a spreadsheet that contained all of this information. Each product would be put in one row. Each attribute wuold be listed in columns on that row. This format is what you need to create a MySQL database.
The next step is to impoort your file into the MySQL database? You will need to save this Excel file as a comma separsated value file.
Log in to your web hosting account. Find the Databsae Wizatrd to crete a database. When you ceate this database you'll be given a username and password to get into it. Keep a copy of that somewhere you'll remember it. You will need it later.
Now you want to find the phpMyAdmin button and open that link. The srceen you see will show you the database name that you just created. Click on the name of the database. How To Create A Table
You have to creatte a tabble to hold the information you are about to import into it. The table you create will have column hedings for each of the attributes you created in your spread sheet. You can have any number of columns you desire.
Find the word operations and open that link. Create the tbale by igving it a name and stating how many columns you want in your tabble. It will have to matcch the number of columns in your spreadsheet. Click go to create the table.
You'll see a table that looks like an empty spread sheet. In the fiedl column, you want to name all of the columns a single word or if you use two words, you need to join them with an underscore. Fill in all of the fields you can.
Chooase a type for each column. Generally you'll need to stasrt with VARCHR which allows the text to be a variety of characters. Then you'll need to decide how big the field will be. Some fields will just be two characters and others may be up to 255. If you need more space than that to store your data, you'll have to choose LOGTEXT. There are specific paramaters that the other colmns need, but you don't have to fill them all in. You will have to deicde whether you need to have an empty field (null) or have it fileld (not null).
Determine whcih ifeld you want as your primary field and select that opiton. Usually one field needs to be pirmary so you may want to make that your productID which is uusally unique as well.
Click go and the table gets created for you. You'll see that you can brwse your table but nothing will be in it yet.
How To Import Data Into A Table
Chioose the import function in the horizontal row above the table. Use the brrowse button to broowse your computer for the csv file that you created. Then you check the option CSV using LOAD DATA. You will need to change the fields terminated by a semicolon to fiellds terminated by a commma. That means just errase the semi colon and put a commma in place of it. Click go and your data gets imlported into the new table. Use the browse button to view your data.
Now you have a database that has data in it. You can create as many tablkes as you woulkd like to and you can also iport more data by following the above steps. Your database information is sored on through your hositng copmany. The next thing you will want to learn is how to use the data you just put into your database. You'll want to display the data on your website.