The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Mysql not working with Apache

Ok, I have been bashing my head against my keyboard the past 3 days, trying to configure apache to run mysql and cgi. Everything is turning into a green mush in my head, and I can't even type right! I need someone else to do some thinking for me...

Ok, here is the scoop: I'm using apache 1.3 on Windows XP pro. I installed apache from the phpdev download. It was supposed to make EVERYTHING work, but for some reason, only php works. The cgi is not recognized and always says "file not found" and the mysql keeps on saying "could not connect to ... " ... same thing with the perl.

My first question is this: since I am using apache on my own computer for my webpage, what is the mysql database server that I should connect to? SHould it still stay localhost, or something else. I can't figure it out.

Secondly, I have put made a my.cnf file, but I'm not sure if I did it right... or if I put it in the rigth place... AKA- I put it in practically every folder of apache (loser that I am)...

... I guess it would help if I stopped bashing my head against the keyboard and started using my fingers :| ...

My my.cnf file:

Here is my my.cnf file (the one that I was told is used for turning on mysql)

# Example mysql config file.
# Copy this file to c:\my.cnf to set global options
#
# One can use all long options that the program supports.
# Run the program with --help to get a list of available options

# This will be passed to all mysql clients
[client]
#password=neothieves
port=3306
#socket=MySQL

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

Re: Mysql not working with Apache

Originally posted by dragonfly_7456 My first question is this: since I am using apache on my own computer for my webpage, what is the mysql database server that I should connect to? SHould it still stay localhost, or something else. I can't figure it out.

localhost

Originally posted by dragonfly_7456 Secondly, I have put made a my.cnf file, but I'm not sure if I did it right... or if I put it in the rigth place... AKA- I put it in practically every folder of apache (loser that I am)...

You don't want to put it in any Apache folders. MySQL is just a program that runs on your computer basically. It doesn't interface with Apache at all, only PHP does that.

WOAH! It runs seperately from apache!? goes to show you how much of a loser I am! Ok, i'm going to go try fixing that. But one more question. In which cases would you use something other that "localhost" ?

$agreement = '<b>Warning/b> This setup process will overwrite any previous WSN Links data. Only use this for a new install.
<br><br><p align=center>
<textarea rows=10 cols=50>
WSN Links License Agreement
----------------------------

You may use this script free of charge for both commercial and non commercial purposes, provided you follow these conditions:

- You may not remove the "Powered by WSN Links" line and link. Doing so is a violation of U.S. and international copyright law as well as a violation of this agreement.

- You may not redistribute (or resell) this script from your own site without special permission from the author. You may, of course, provide links on your site to http://scripts.webmastersite.net/wsnlinks... but for obvious reasons you may not link directly to the .zip file.

You may edit/alter the source code of this script as much as you like, providing you retain the "Powered by WSN Links" line in all versions you create. Note, this script is provided "as is" and no guarantees are implied.
</textarea><br>
<form name=agreeform action=setup.php?agree=yes method=POST>
<input type=submit value="I Agree">
</form></p>';
echo $agreement;
}

First make sure mySQL is working. Are you sure it is? Have you been able to log in to the console? Have you been able to change the root user's password? These things aren't necessary for mysql to work, but they will be good to know ultimately anyway and will provide valuable info as to whether or not mySQL is indeed working.

Anyway, you are getting frustrated really quickly. Just to give you some perspective, if you were doing this installation on certain Unix systems, there's a good chance you'd have to create a new system user, compile mySQL, install it, make sure the server deamon was launch everytime the system starts up .... and then you'd be where you are now!

So relax!

Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

Hehehe, I see what you mean. Ok, I downloaded it, and installed it without any difficulty. Ok, the control panel is the WinMySQLadmin.exe right? Seems like it. So, now how do I launch mysql scripts on the internet through apache?

That's great news! Not having mySQL installed really makes using mySQL difficult!

Before you try to get mySQL working with PHP I suggest you tool around with mysqladmin. Add a database, add tables, etc.

Then go here: http://www.mysql.com/articles/ddws/
Read over the installation chapter briefly. You've already done most of that stuff. However, you probably would like to change the mysql root user password.

When you finish, continue to the mysql chapter. This is a really well written article for the beginner and covers just about everything you need.

Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

It has all been worth while! :D

After a long and bloody 6 days of brain bashing, I have finally installed MySQL on my server. Everything works PERFECT! Thank you everybody for helping me out! I have got to admit, this is one of the best forums I have EVER seen!!! Now mabye I'll just go and make my own! hehehe... and to think that I had almost quit!