PDA

View Full Version : MYSQL, PHP



Myth
13-06-2009, 08:06 AM
I would like to learn MYSQL as it will be financially beneficial in the shortish term for me

From what I have read so far, MYSQL requires PHP. I want to set up my spare XP box so I can learn/practice.

How do I go about getting it all set up and having a fake database to practice with? I am hoping all software is free??

jcr1
13-06-2009, 09:06 AM
Myth, I've done this a couple of times, once on Debian http://www.howtoforge.com/perfect_setup_debian_etch
This is a real good one, and it worked a treat for me, I guess it'll work equally well with the likes of Ubuntu, if you prefer that one.

I've also used wamp (windows, apache, mysql, php) on XP, it works fine as well.

Now that I've got a Synology server, I've got PHP MySQL as part of the set up and I don't notice the difference from the Debian setup I used to have.

PuTTy is a superb tool for command line stuff, which is necessary now and then for MySQL. But there are good semi GUI interfaces as well, i.e. PHPmyAdmin.

There's heaps of stuff on the internet on this, and I guess, my son being a developer, who just loves PHP, was a great help to me.

jcr1
13-06-2009, 09:08 AM
And I forgot to mention. All software is absolutely free:thumbs:

Erayd
13-06-2009, 11:25 AM
...From what I have read so far, MYSQL requires PHP...Whatever you're reading, throw it away. MySQL does not require PHP in any way, shape or form and whoever fed you that nonsense should be shot.


How do I go about getting it all set up and having a fake database to practice with? I am hoping all software is free??
As far as setting it up goes, that's pretty simple - just download the installer package from here (http://dev.mysql.com/downloads/mysql/5.1.html#downloads) and install it. Yes, this is free software. If you are *wanting* a webserver & PHP with it you might want to wonsider a pre-packaged combo like xammp or uniform server, but this is by no means necessary.

You might also want to consider installing some kind of GUI tool if you've never used a relational database before, it'll make your life a lot easier.

nofam
13-06-2009, 11:39 AM
Erayd might shoot me for saying this (please, no!! :dogeye:) but MS Access is actually a really good to learn some of the fundamentals of relational databases; you can easily point it to a MySQL database by installing an ODBC driver, then setting up a DSN on your PC so it uses that driver to link to the tables in your DB.

Access is really only a toy in terms of it's functionality compared to what guys like Erayd do with a CLI, but it's fully graphical, and will teach you about normalizing the data in your tables, how you should/shouldn't join tables, making tables etc etc. It can also take your graphical representation of a query and show your the SQL code behind it, which is a great way to understand how the syntax works (SQL is really simple code). You can also set up forms in Access to populate your DB, and learn some good design fundamentals here as well.

:thumbs:

MushHead
13-06-2009, 12:13 PM
Have a look at XAMPP. That will give you a simple Apache/MySQL/PHP/Perl environment that runs under Windows - free, of course! There's a video here (http://www.youtube.com/watch?v=KWRB-maTVyM) that should give you a good start.

Erayd is right, you don't need PHP for MySQL, but you'll generally use one of the common scripting languages to integrate Web pages with a MySQL database (I'm assuming that's probably what you're trying to achieve) - PHP/Perl/Python are the common ones, but you can use a bunch of others - even the .NET family, for example, if that floats your boat.

Erayd
13-06-2009, 12:31 PM
Erayd might shoot me for saying this (please, no!! :dogeye:):badpc: :ban


...but MS Access is actually a really good to learn some of the fundamentals of relational databases; you can easily point it to a MySQL database by installing an ODBC driver, then setting up a DSN on your PC so it uses that driver to link to the tables in your DB.

Access is really only a toy in terms of it's functionality compared to what guys like Erayd do with a CLI, but it's fully graphical, and will teach you about normalizing the data in your tables, how you should/shouldn't join tables, making tables etc etc. It can also take your graphical representation of a query and show your the SQL code behind it, which is a great way to understand how the syntax works (SQL is really simple code). You can also set up forms in Access to populate your DB, and learn some good design fundamentals here as well.

:thumbs:
Oh please god no... don't go near Access. By all means use a decent GUI tool for messing with databases - they can make life a lot easier - but stay away from access. It's a far better idea to learn on a system that may actually end up being one you see in a production environment (and yes, I'm aware some people use Access in production, but that's *always* a bad idea - Access doesn't scale at all). Each DBMS has its little quirks and features, and it's far more useful to learn the ones that apply to a system you might actually use.

vinref
13-06-2009, 12:54 PM
I would like to learn MYSQL as it will be financially beneficial in the shortish term for me

From what I have read so far, MYSQL requires PHP. I want to set up my spare XP box so I can learn/practice.

How do I go about getting it all set up and having a fake database to practice with? I am hoping all software is free??

Why don't you make it even easier on yourself by putting Ubuntu or Fedora on that XP box? Install MySQL and say, php5-mysql via their packages systems and a large amount of stuff gets done for you automatically.

You can even install some great php scripts like Drupal via the packages systems and play around with that.

ubergeek85
13-06-2009, 05:39 PM
It's already been mentioned, but xampp is a great pack. Just unzip to your C: drive, and start a couple of batch files, and you've got MySQL and Apache up and running, with PHP and perl support.

In it's basic state, it's not too secure, but unless you want to deploy it as a production server, you'll be alright. Even then, it's not too hard to lock down.

One way to get a hands-on approach is to download and install phpBB3. Have a look though the php code to see where the SQL is, what it's doing, etc. Then you can browse the DB with the inbuilt browser in xampp. If you're feeling game (and don't mind breaking phpBB), have a go changing some bits n pieces of SQL and see what happens.

Myth
14-06-2009, 12:24 AM
Thanks for the advice :)

I have linux already (on this box). The intention is not to keep mysql etc (well at this stage) hence why its going on other machine. Its just to learn/practice.

And I won't be going anywhere near Access, had dealings with it before and don't like it. Besides, I need to learn mysql and its syntax, not Access