Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache and MySQL

Status
Not open for further replies.

audiopro

Programmer
Apr 1, 2004
3,165
GB
I run an Apache server on a windoze box and need to get into the dizzy world of MySQL. I understood that MySQL was only a database but having read endless docs. it appears to be a server too. I run PERL on the Apache server and I wonder if there are any compatibility issues.
It may be I am barking up the wrong tree and I am anticipating problems which simply do not exist.
If this is the case please accept my apologies for being numb.

Keith
 
MySQL is a database server, which accepts connections via TCP/IP from client programs. It will happily co-exist with Perl and Apache on a Windows machine.
 
Thanks for that.
I am just starting to get into MySQL and it seems to me that except for syntax issues the whole process is similar to getting info from pre defined multi dimensional arrays.
Can you point me in the direction of a good tutorial which starts at the bottom and works upwards.
The one on ????://dev.mysql.com appears to be the best I have seen so far.

Keith
 
You can download the MySQL manual from the MySQL website, but it is quite technical for a novice. There is also a wide range of books available, for example "MySQL" (3rd edition) by P. DuBois, published by Developers Library, which caters for beginners as well as experts. Any tutorial on the basics of relational databases and SQL would also be useful.
 
I am well versed with Microsoft Visual Foxpro so I guess the main learning curve will be syntax. I tend to learn better from ripping apart examples although a reference manual is essential to learn about new commands.

Keith
 
I have been looking round various sites for MySQL and the PERL DBI interface. There are many different options available but I am unsure which one I should be using.
I have downloaded mysql-essential-4.1.13a-win32.msi as it seems the most likely SQL file. The question is what do I do with an MSI file?
Is there a site out there somewhere which gives clear instructions on how to install and set up the file system.

Keith
 
An MSI file is a Windows installer file. Just open the file; if nothing happens, then you need to get and install Windows Installer and try again. An easy-to-use wizard guides you through the installation process.

An alternative (and my preferred option) is to use the Windows no-installer package. All you have to do is to copy the unzipped directory to your hard drive (preferably "c:/mysql"), set up a simple configuration file if needed, install the service if desired, and you're in business. If you need help with that, get back to us.

When you have it installed, you will then need the Perl modules DBI and DBD:mysql . You probably already have them, but if not, you can get them from CPAN.
 
Thanks for yor help so far but I feel there is a long way to go.
MySQL in place - Not sure yet if it is configured right
Perl DBI and DBD:mysql modules are installed, pot of tea replenished and bladder empty.
Off in search of some examples now, just to get a feel of things. Wish me luck.

Keith
 
I am getting nowhere fast at the moment.
I am using WIN98, do I need to launch MySQL in some way or should it be enough to just call DBD::mysql
I have been trying to find a piece of working code to play with but everything I have tried so far errors.

Keith
 
Yes, MySQL must be running. On servers this means as a service, I think on Win98 and below it must run as an application.

I'd suggest visiting and downloading the xampp package.
 
Also, you can play with MySQL without using Perl, by using one of the dedicated client programs. There's the "mysql" command-line client (bundled with the server); a GUI client like MySQL Query Browser (available from the MySQL site); or the MySQL ODBC connector (available from the MySQL site) which allows you access the database from applications like OpenOffice.org or any other ODBC-aware app.
 
If you're going to be doing web development under apache, seriously consider ditching Perl and use PHP. You will love yourself in the morning.

For beginning to play with mysql, try downloading MySQLAdmin, a GUI management tool, from MySQL's developer website.

Also, a SQL RDBMS is to FoxPro as a Lexus M36 is to a '57 Chevy. You should google for a couple of SQL tutorials to get an understanding of how the language interacts with the data using the concepts of set theory rather than manhandling it in for loops like in FoxPro. Look for something in ANSI SQL, skip anything that specifically mentions Oracle, because they are just barely ANSI compliant

 
I have been working through some of the theory and creating tables, reading tables and performing SQL selects seems straight forward enough. I know some queries can be very complex but the theory is quite straight forward.
One thing which puzzles me is how to edit an existing record. This I assume is done by replacing a particular field elememt with a new value. How do I address a particular record? That is the part of MySQL which I need some info on. Can anyone reccomend a good tutorial which deals with this aspect?

Keith
 
You need to identify the record somehow in the UPDATE statement.

For example, to change someone's phone number in your customer list, you'd have something like "UPDATE customers SET phone1='555-5555' WHERE accountid='12345';"

In this case, "accountid" is the unique key that will specifically identify the record.
 
I need to get the basics in place before venturing any further. Is there an auto increment feature to use in conjunction with the UNIQUE field?
It looks as though there are some serious pitfalls when it comes to non ANSI operations. Are there any specific discussions on this topic.
I use many SELECT statements within FOXPRO but only to identify data with matching criteria, not to update data.


Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top