View Full Version : What is MySQL, it has me foxed
Nigelsl
15th May 2009, 20:04
I haven't posted here for a long while, but having been in business now for almost five years, I've decided to follow the trend and enter the mystic world of ecommerce. I bought a programme to write the website, which is almost done, registered the domain and bought an ecommerce package with a hosting company. All okay so far, but with the package comes two MySQL databases which will be on a Linux server. (my OS is windows, does that matter) I thought that the easiest way of adding products, etc would be to put them in a database and 'point' various areas of the website to the information it contains. Here is my problem, I've never come across this database before, there is very little help on the hosting website, so can anyone tell a complete novice how I go ahead and create such a thing. I expect the answer will not be a simple reply, although I have read that it is the best database available and easy to create one.
Am I being too simplistic, can anyone please point me in the right direction? or should I be using something else.
Many thanks
FireFleur
15th May 2009, 20:25
You should get it working locally first in MySQL then transfer the data into the live database.
If you are forced to do this live, because the data structures are not available for download you have two problems, the first is backup and the second is having to develop on live.
A database is there to manage data, and the structures that are defined model that data for the problem you are solving.
Access to a database is done via an API (application programming interface), normally you gain a connection the database and then supply it with commands to retrieve the data you want as a view, insert or update the data.
So assuming a table like:
create table products (
id int auto_increment primary key,
name varchar(255),
description text,
price monetary
);
The types are a bit made up by me here, should be MySQL compliant.
Then to select a particular product, you could run a select such as:
select name, description, price where id = 1;
That would return the name, description and price for a product with the id of 1.
But better to create a view and then select that view, so there it is more defined.
You would send the SQL commands via the application which has a connection to the DB.
It sounds to me like you need a developer, or to get some books on mysql.
Databases are simple to use, but awkward to set up, you also want to ensure that you are protected from SQL injection attacks.
greenbox
15th May 2009, 20:27
ok i will try and explain in lay mans terms, Mysql is a database program.
From what you say your host allows you 2 databases you use the mysql program to create your databases upto 2 in your case.
If you think of using excel to create spreadsheets you get the idea.
Here is a general explanation of how most eccomerce systems are setup with regards to the database:
You should only need to use one database for your ecommerce website.
I would guess that your database/s have already been created (cant be sure as dont know who your hosts are).
Think of the database that has been created for you (by your hosts), as a blank canvas that needs to be fleshed in.
Most eccomerce systems will have a script (you run when setting them up), that will 'fill' in your database with the structure
it needs i.e. it will create the tables that the database uses.
You will need to provide the eccomerce system with the details of the database eg location, username and password. Before running
the setup script.
Once you have configured the setup script and run it, your eccomerce site will be ready for use and you can upload your product details.
Hope that helps and good luck.
Nigelsl
15th May 2009, 21:07
Thanks for that, I think I understand, but a trip to WH Smiths is on the cards, does anyone know where I can get a copy of MySQL, I believe that it is free
davidshaw89
15th May 2009, 21:32
You can download mysql here:
http://dev.mysql.com/downloads/
chasd
18th May 2009, 19:54
Hi Nigelsl,
Once upon a time I went skiing. It was the first time I had been skiing. An Olympic skiing champian was in the cable car with me going to the top of a mountain. He asked how long I had been skiing. I said three days. He said "You are very brave!" He later helped get me down the mountain and kept me from killing myself.
I know how you feel and also that you are in the same positiion that I was in.... way out of my depth! Getting a web page to connect to a database, mysql or otherwise is a complicated business. (mysql is a very good, powerful database) There is much more to what you need than just connecting to it!
You might find the following useful. In general terms a customer's request or data entry in a web page is sent to your provider's "web server", which then connects to an "application server" on their site containing the programming or "business logic" to process the request. The business logic is written in a computer language, such as Java, PHP, Python or Perl for example. The business logic connects to a "database server" (often referred to as the "back end" since it is the bit at the back :-) ) whenever it is necessary to store or retrieve data. To achieve this you will need to know how to write the business logic, ie be a programmer, how to write SQL (Structure Query Language) and understand database structures in order to do this. (The sort of stuff I learned how to do as part of my MSc training - appologies to undergrads in advance!) Not trivial.
I dont want to discourage you and appreciate your short shoe strings, but it might be better if you used a ready-made OpenSource (free) package which hides the complicated stuff in preference to attempting building a system from scratch yourself. I have seen several packages mentioned in other threads which may provide the solution you seek.
If you need general help or whatever, then please let me know.
Good luck!
Chas
FireFleur
18th May 2009, 21:08
Getting the books is a good idea anyhow. Then you have access to a third party of the raw elements your business is running on.
When you gain an appreciation then you can decide and work better with a developer, just remember that a little knowledge can cause a lot of damage, so think about creating trial databases and recovery early on, not later if you do dabble :)
edmondscommerce
18th May 2009, 21:14
i just bought a copy of webmaster guidebook by oreilly from amazon for 1p (for my wife)..
it wasnt the latest version but for 1p im not complaining
zoezoe
19th May 2009, 16:49
I am stunned. Simply stunned. Why would someone who could not just google "mysql" and find a wealth of resource on the subject want to build a website using mySQL?
I just don't get it.
Why is it that when it comes to website development - everybody thinks that they can do it? This is not true for any other trade. People call the plumber, go to hairdressers, get the car fixed at the garage - yet when it comes to websites and web applications people think that they can do it and save time/money?
Would be interested to see how far the OP got!
chasd
19th May 2009, 17:03
That is a very good question.
On reflection, what does the 'ecomerce' provider acutally provide the OP? If only the core infrastructure, (ie Apache web server, mysql data and PHP/Java/Python/Perl support via Apache, then he needs a qualified developer or to find another provider, etc.
J-Wholesale
19th May 2009, 19:10
I just don't get it.
Why is it that when it comes to website development - everybody thinks that they can do it? This is not true for any other trade. People call the plumber, go to hairdressers, get the car fixed at the garage - yet when it comes to websites and web applications people think that they can do it and save time/money?
Actually, it is true for all those examples you've just mentioned. There are many DIY 'experts' who have a go at fixing the kitchen sink, many wanabee hairdressers who take a scissors to their husband's hair, and even more cash strapped mechanics who try fixing their own car. I remember my first car - I was penniless at the time, and learned how to change the radiator before I'd changed a wheel.
And it's just as true for website development. A reasonably smart person who's not afraid of computers and capable of learning from a book would be quite capable of working out how a MySQL database works. To use a tired old phrase: It ain't rocket science.
edmondscommerce
19th May 2009, 19:11
Why is it that when it comes to website development - everybody thinks that they can do it? This is not true for any other trade. People call the plumber, go to hairdressers, get the car fixed at the garage
Nice analogy but I think you have it all wrong.. people do think they can do it all
http://www.liverpoolecho.co.uk/liverpool-life/real-life-stories/2008/09/25/father-to-be-s-diy-disaster-as-he-superglues-his-hand-to-the-worktop-100252-21898807/
FireFleur
19th May 2009, 19:16
And rocket science is not that hard either. You can make your own rockets.
Pros give speed and quality, but we are all just human after all.
It is interesting some fields do get protection though, and tend to suffer from it as far as the service delivered.
WPsites
20th May 2009, 10:24
MySQL is usually administered from a command line but you can get a web based program called phpmyadmin that will allow you to connect to your mysql database, that has a more user friendly graphical interface.
TotallySport
20th May 2009, 11:37
MySQL is usually administered from a command line but you can get a web based program called phpmyadmin that will allow you to connect to your mysql database, that has a more user friendly graphical interface.SQLyog is another one.
http://www.webyog.com/en/