• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need help setting up a phpbb forum on my local machine

NathanBWF

Golden Member
Apache is working, PHP is installed correctly, I've created the mysql database and am trying to run the install.php file. I enter in everything and when I try to continue, it get the following error:

phpBB : Critical Error

Could not connect to the database


Obviously it can't find the database. I've made sure the username and password are correct for mysql, but am not sure if it is looking in the right direction. I've got MySQL installed to the default location "c:\program files\mysql\mysql server 5.0".

Ideas?
 
Is it accepting network connections (as opposed to whatever the native pipes thing is)? Is it listening on the default port? Do you have a firewall running that might get in the way? Is that exactly the entire error message?
 
Originally posted by: kamper
Is it accepting network connections (as opposed to whatever the native pipes thing is)? Is it listening on the default port? Do you have a firewall running that might get in the way? Is that exactly the entire error message?

Yes, accepting network connections is enabled. It's running on port 3306 (I tried changing that during the install process as well but no luck. No firewall is running. Entire error message is that one I posted originally.
 
I can't find any worthwhile documentation on phpbb's site. :|

Does phpbb use a local socket or connect to the database over the network? You've verified that you can connect to the database with the mysql command? Using the username/password for phpbb? Did you fat finger a password?
 
Originally posted by: n0cmonkey
I can't find any worthwhile documentation on phpbb's site. :|

Does phpbb use a local socket or connect to the database over the network? You've verified that you can connect to the database with the mysql command? Using the username/password for phpbb? Did you fat finger a password?

I can connect to the database with that same username and password via the command prompt. I doubled checked that I didn't fat finger anything. It's almost like it doesn't know where to look for the database.

The more research I do on the net...the more I think that the problem is that I used the damn MySQL installer. I may re-install using the zipped package if I can't get this going soon...
 
Ok, so the ****** documentation on their website is the same ****** documentation they pass out with the code.

Does phpbb have permission to access the mysql socket? What does the configuration look like?

EDIT: Oops, I didn't realize this wasn't on a real OS. I guess it won't use unix sockets then... Is there a firewall in the way?
 
Originally posted by: n0cmonkey
Ok, so the ****** documentation on their website is the same ****** documentation they pass out with the code.

Does phpbb have permission to access the mysql socket? What does the configuration look like?

EDIT: Oops, I didn't realize this wasn't on a real OS. I guess it won't use unix sockets then... Is there a firewall in the way?

No firewall is installed, Windows Firewall is turned off.
 
Check the phpbb log for more information.
Is there a configuration file you can post?
Did you select the right database type?
Did you enter "localhost" for the server name?
 
Originally posted by: n0cmonkey
Does phpbb use a local socket or connect to the database over the network? You've verified that you can connect to the database with the mysql command?
Pretty sure that phpbb uses the network and the windows mysql client uses pipes by default for a local server (although I very well could be wrong on that last one, their documentation isn't helping me much).

At any rate, at this point, I'd be firing up a packet sniffer and, of course, using your machine's actual ip address instead of localhost. At least that way you should be able to find out if it's phpbb's fault, mysql's fault or something in the middle.
 
Originally posted by: kamper
Originally posted by: n0cmonkey
Does phpbb use a local socket or connect to the database over the network? You've verified that you can connect to the database with the mysql command?
Pretty sure that phpbb uses the network and the windows mysql client uses pipes by default for a local server (although I very well could be wrong on that last one, their documentation isn't helping me much).

At any rate, at this point, I'd be firing up a packet sniffer and, of course, using your machine's actual ip address instead of localhost. At least that way you should be able to find out if it's phpbb's fault, mysql's fault or something in the middle.

At this point, I'm pretty sure that the problem is that phpBB doesn't know where to look for the MySQL database. I'm just trying to figure out where MySQL needs to be installed. Would it need to be in the same directory as the rest of the phpBB files, or maye just in the htdocs directory?
 
Originally posted by: NathanBWF
Originally posted by: kamper
Originally posted by: n0cmonkey
Does phpbb use a local socket or connect to the database over the network? You've verified that you can connect to the database with the mysql command?
Pretty sure that phpbb uses the network and the windows mysql client uses pipes by default for a local server (although I very well could be wrong on that last one, their documentation isn't helping me much).

At any rate, at this point, I'd be firing up a packet sniffer and, of course, using your machine's actual ip address instead of localhost. At least that way you should be able to find out if it's phpbb's fault, mysql's fault or something in the middle.

At this point, I'm pretty sure that the problem is that phpBB doesn't know where to look for the MySQL database. I'm just trying to figure out where MySQL needs to be installed. Would it need to be in the same directory as the rest of the phpBB files, or maye just in the htdocs directory?

It shouldn't matter. Communication should be going over the network (preferably localhost/127.0.0.1) to port 3306. On that install.php page you should be able to put in the hostname of the database server (127.0.0.1 or localhost), and it should be able to find it. It should default to port 3306 if you selected the right database from the drop down list.
 
Originally posted by: n0cmonkey
Originally posted by: NathanBWF
Originally posted by: kamper
Originally posted by: n0cmonkey
Does phpbb use a local socket or connect to the database over the network? You've verified that you can connect to the database with the mysql command?
Pretty sure that phpbb uses the network and the windows mysql client uses pipes by default for a local server (although I very well could be wrong on that last one, their documentation isn't helping me much).

At any rate, at this point, I'd be firing up a packet sniffer and, of course, using your machine's actual ip address instead of localhost. At least that way you should be able to find out if it's phpbb's fault, mysql's fault or something in the middle.

At this point, I'm pretty sure that the problem is that phpBB doesn't know where to look for the MySQL database. I'm just trying to figure out where MySQL needs to be installed. Would it need to be in the same directory as the rest of the phpBB files, or maye just in the htdocs directory?

It shouldn't matter. Communication should be going over the network (preferably localhost/127.0.0.1) to port 3306. On that install.php page you should be able to put in the hostname of the database server (127.0.0.1 or localhost), and it should be able to find it. It should default to port 3306 if you selected the right database from the drop down list.

That's what I kind of figured, which is why I can't figure out why it can't find the database.
 
Originally posted by: cougar78
in the install index.php what are you putting as the path to your db?

I've tried localhost, 127.0.0.1, my IP address, etc for the server name. Still no go. (It doesn't ask for the specific db path).

I'm wondering if I have to add "Listen 3306" to my httpd.conf file? I tried it but when I went to restart Apache it gave me an error. As soon as I take that line out the service restarts no problem.

:|

I also tried setting MySQL to use port 80 instead of 3306...but when I make that change then that service doesn't want to restart! Seems like it's only content on port 3306...
 
Originally posted by: NathanBWF
I'm wondering if I have to add "Listen 3306" to my httpd.conf file? I tried it but when I went to restart Apache it gave me an error. As soon as I take that line out the service restarts no problem.

:|

I also tried setting MySQL to use port 80 instead of 3306...but when I make that change then that service doesn't want to restart! Seems like it's only content on port 3306...
Neither of those make any sense. Putting apache on port 3306 puts you in conflict with mysql and the service won't start because it can't bind to the port you told it to. Exact same thing in the other case: mysql can't bind to port 80 because apache's already got it. You could put it on just about any other port you want, but it's not going to help.

And putting mysql anywhere in the htdocs folder is about the worst place you could have it 😛

Can you telnet to localhost:3306? That would at least tell you if mysqld is accepting connections properly. Or try using the mysql client from another machine.
 
Originally posted by: kamper
Originally posted by: NathanBWF
I'm wondering if I have to add "Listen 3306" to my httpd.conf file? I tried it but when I went to restart Apache it gave me an error. As soon as I take that line out the service restarts no problem.

:|

I also tried setting MySQL to use port 80 instead of 3306...but when I make that change then that service doesn't want to restart! Seems like it's only content on port 3306...
Neither of those make any sense. Putting apache on port 3306 puts you in conflict with mysql and the service won't start because it can't bind to the port you told it to. Exact same thing in the other case: mysql can't bind to port 80 because apache's already got it. You could put it on just about any other port you want, but it's not going to help.

And putting mysql anywhere in the htdocs folder is about the worst place you could have it 😛

Can you telnet to localhost:3306? That would at least tell you if mysqld is accepting connections properly. Or try using the mysql client from another machine.

Hmm. Good call. I tried via telnet through port 3306 and I get "Bad Handshake. Connection to host lost."

Unless perhaps my syntax is wrong or something...

Regardless, it doesn't appear to be accepting connections on port 3306 properly.
 
telnet localhost 3306

There's not much you can do wrong with that. 🙂 But I concur, looks like a mysql problem and not just configuration. A bad handshake sounds like something is actually wrong with the networking code.
 
I got this error installing phpBB but it was because I entered the wrong user/password for the database, if I can remember correctly. Or, it was because I didn't have a table in the database that I needed.
 
Originally posted by: kamper
telnet localhost 3306

There's not much you can do wrong with that. 🙂 But I concur, looks like a mysql problem and not just configuration. A bad handshake sounds like something is actually wrong with the networking code.

Yeah that's the line I tried. Something is fubared.
 
Originally posted by: xtknight
I got this error installing phpBB but it was because I entered the wrong user/password for the database, if I can remember correctly. Or, it was because I didn't have a table in the database that I needed.

I've tripled check the username/pw, so I don't think that's the problem. I don't think you have to create any tables, the phpBB install process takes care of all of that...
 
Originally posted by: NathanBWF
Originally posted by: kamper
telnet localhost 3306

There's not much you can do wrong with that. 🙂 But I concur, looks like a mysql problem and not just configuration. A bad handshake sounds like something is actually wrong with the networking code.

Yeah that's the line I tried. Something is fubared.
Alright, then what I'd do is remove mysql in it's entirety if you can do that. Then make sure you've got a stable version (nothing too cutting edge) and follow the istallation instructions word for word to see if you can get it to work.

Actually before you do that, do try using the mysql client from another machine first to see if you can connect via the network. Or maybe you can just direct it to the non-loopback ip of your machine. I assumed that the "Bad handshake" message was referring to a tcp handshake, but maybe it's just a misleading error message that mysqld puts out because telnet didn't follow the connection protocol.
 
Originally posted by: kamper
Originally posted by: NathanBWF
Originally posted by: kamper
telnet localhost 3306

There's not much you can do wrong with that. 🙂 But I concur, looks like a mysql problem and not just configuration. A bad handshake sounds like something is actually wrong with the networking code.

Yeah that's the line I tried. Something is fubared.
Alright, then what I'd do is remove mysql in it's entirety if you can do that. Then make sure you've got a stable version (nothing too cutting edge) and follow the istallation instructions word for word to see if you can get it to work.

Actually before you do that, do try using the mysql client from another machine first to see if you can connect via the network. Or maybe you can just direct it to the non-loopback ip of your machine. I assumed that the "Bad handshake" message was referring to a tcp handshake, but maybe it's just a misleading error message that mysqld puts out because telnet didn't follow the connection protocol.

Alright, I tried using the MySQL client from another machine on the network and it connected fine through port 3306, with the same username/pw I'm trying to use during the phpBB setup. No problems.

I've tried removing/re-installing MySQL about 10 times now (tried versions 4 and 5). Same error every time.

I'm stumped. 🙁

 
Know any php? Hack up a dead simple connection script as a proof of concept to use for testing. Then grab ethereal and sniff the connection process. I'm guessing (and no offence) that it'll be a little over your head, but it's a fantastic way to learn if you're interested.
 
Back
Top