|
-
Mar 12th, 2005, 12:15 AM
#1
Thread Starter
Fanatic Member
PHP and MySQL
We need to setup a forum for an upcoming event in college. I tought I would create my own server and use my computer as the server to play around with 'phpBB' (Msg Board Software).
I dowloaded Apache2, PHP 4.3.10 and MySQL 4.1 and I am running XP Prof.
Apache running... check!
PHP running... check!
MySQL running... check!
I copy-pasted the phpBB files to a sub folder in the htdocs folder and ran the installation.
However it didn't complete giving me an error: 'phpBB Critical error' 'Could not connect to database' (newline). I tried the same process with IPB 1.3 for experiment sake. It gave a better error:
Warning!
The following errors must be rectified before continuing!
Please go back and try again!
Could not create a mySQL connection, please check the SQL values entered
I think PHP cannot find the path to the db or I haven't set some required settings. I just installed MySQL using the Windows Installer and didn't do anything extra, although I changed some settings in Apache and PHP as required.
Please help
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 12th, 2005, 01:58 AM
#2
Re: PHP and MySQL
Check the values you've entered for connecting to the database.
MySQL Server Name: (localhost)
User Name: (your user name)
Password: (your password)
Database: (the name of the database you want to connect to)
HTH 
Can you connect to any other databases?
-
Mar 12th, 2005, 02:21 AM
#3
Thread Starter
Fanatic Member
Re: PHP and MySQL
 Originally Posted by lintz
Check the values you've entered for connecting to the database.
MySQL Server Name: (localhost)
User Name: (your user name)
Password: (your password)
Database: (the name of the database you want to connect to)
HTH
Can you connect to any other databases?
I had already did what you told me to. Still it does not work. I can connect properly into MySQL using 'MySQL Command Line Client'. Not sure how to check using any other method. I am a newbie .
How do I check if I have a proper MySQL connection
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 12th, 2005, 04:45 AM
#4
Re: PHP and MySQL
You need to run some kind of install / configuration script first where you tell it what database you will use. Look at this page where it says:
Once all the files have been uploaded to your site you should point your browser at this location with the addition of install/install.php (please note that if you changed the extension from php, see Section 3.i below, you should alter install.php appropriately). For example if your domain name is www.mydomain.tld and you placed phpBB 2 in a directory /phpBB2 off your web root you would enter http://www.mydomain.tld/phpBB2/install/install.php into your browser. When you have done this you should see the phpBB 2 Installation screen appear.
-
Mar 12th, 2005, 08:14 AM
#5
Thread Starter
Fanatic Member
Re: PHP and MySQL
 Originally Posted by visualAd
You need to run some kind of install / configuration script first where you tell it what database you will use. Look at this page where it says:
Hey visualAd, the error occurs after I hit submit in the intallation page (The page you directed me to). I think PHP cannot find my database, nor the path where MySQL is installed. I am running MySQL as a service. Apache2 is installed in my own computer and I am the web server.
Any idea how to check if MySQL is properly setup... ie check if I can connect to it.
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 12th, 2005, 08:26 AM
#6
Re: PHP and MySQL
You can test it by going to the command line. Typee cmd in the Start Menu->Run and enter the following:
Code:
> cd C:\path\to\mysql\
> cd bin
> mysql -h localhost -u root
If that doesn't work and you get an error it means your MySql server probably isn't running.
-
Mar 12th, 2005, 08:41 AM
#7
Thread Starter
Fanatic Member
Re: PHP and MySQL
 Originally Posted by visualAd
You can test it by going to the command line. Typee cmd in the Start Menu->Run and enter the following:
Code:
> cd C:\path\to\mysql\
> cd bin
> mysql -h localhost -u root
If that doesn't work and you get an error it means your MySql server probably isn't running.
Nope not working...
Error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
We are getting somewhere...
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 12th, 2005, 08:48 AM
#8
Thread Starter
Fanatic Member
Re: PHP and MySQL
Follow up....
it works when I do the following...
mysql -u root -p or
mysql -u root -p -h localhost
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 12th, 2005, 09:12 AM
#9
Thread Starter
Fanatic Member
Re: PHP and MySQL
More follow up...
The following error occured with phpMyAdmin...
#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 12th, 2005, 09:37 AM
#10
Re: PHP and MySQL
Hmm, this is weird. Especially seeing as both MySQL and PHP seem to be at their latest versions. (Excepting PHP5, of course.)
OK, I think I discovered the reason. The PHP docs mention the constant MYSQL_CLIENT_SSL in the mysql extension and have this to say about it:
Use SSL encryption. This flag is only available with version 4.x of the MySQL client library or newer. Version 3.23.x is bundled both with PHP 4 and Windows binaries of PHP 5.
It seems that your setup of MySQL requires the client to connect via SSL. But since you probably used the binary PHP version, you have the wrong client library.
Two solutions:
1) Find the configuration that controls access to MySQL and remove the SSL requirement. As long as MySQL only listens on 127.0.0.1 (which it should by default) there should be no security impact.
2) Compile PHP by hand, forcing it to use an up-to-date mysql client library.
http://www.php.net/manual/en/install...s.building.php
Of course, while the latter step should be preferred, it's very hard, especially since there's no real documentation on how to change the used mysql library. It mentions something about changing the file main/config.win32.h, but no more. Also, this might require you to get the MySQL sources as well. (And you already need the Apache sources to compile the PHP Apache module...)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Mar 12th, 2005, 10:36 AM
#11
Re: PHP and MySQL
First thing I'd do is to put a password on that root account. That's like having "sa" no password in SQL Server. Bad juju.
Secondly,root shouldn't be used for applications. Create a second user, give it ONLY the permissions is needs. Then grant it access to the database you plan to use for your BB.
Change the config file to reflect the new user & password.
Tg
-
Mar 12th, 2005, 03:42 PM
#12
Re: PHP and MySQL
You can refer to this link for the solution this problem:
http://dev.mysql.com/doc/mysql/en/old-client.html
This is confusing because MySql wouldn't bundle old clients with their latest version, so at the very least you should be able to connect with the the MySql client. MySql.exe. I think the best thing you can do is create a My.ini file in the root directory of the MySql installation and enter the line "old_passwords".
-
Mar 13th, 2005, 02:29 AM
#13
Thread Starter
Fanatic Member
Re: PHP and MySQL
If all the above complex (for me) stuff doesn't work, would switching to version 3.xx work?
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 13th, 2005, 03:06 AM
#14
Thread Starter
Fanatic Member
Re: PHP and MySQL
I don't know what I did, but the installation was successful 
Thanks a million visualAd, CB and techgnome
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Mar 13th, 2005, 03:15 AM
#15
Thread Starter
Fanatic Member
Re: PHP and MySQL
Oh btw, I don't have a FTP server; hence couldn't do the CHMOD requirements. Is there anyway I can do this through Windows folder window?
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|