index.php not communicate with MySql database

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
php_user
Registered User
Posts: 138
Joined: Wed Nov 06, 2002 7:23 am
Location: Sweden, Gothenbourg

index.php not communicate with MySql database

Post by php_user »

Hello. I istall phpbb, Apache and MySql database. When i istall new phpbb2 database its works 100%. But then i copy old phpbb (v2.0.10) script and old mysql (v.3x) files to new installed host and run index.php. I can see startpage (index.php) but there is no communication with mysql database.

I wondering why index.php dont get respond data in mysql database.
Any ideas where i can solve this

OS; Win XP Home, IE.
Host; Apache, latest
DB; MySql v.4.15
php v.5

Regards
Mathias
Gothenbourg, Sweden.
User avatar
Lumpy Burgertushie
Registered User
Posts: 68181
Joined: Mon May 02, 2005 3:11 am
Contact:

Post by Lumpy Burgertushie »

to start with, php5 does not work well with phpbb.

please give us exact error messages or details of what you are doing and what happens.

saying it is broke, doesn't tell us anything.

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
AcousticJames
Registered User
Posts: 970
Joined: Wed Jul 13, 2005 5:59 am
Location: St. Cloud, MN
Contact:

Post by AcousticJames »

First off, you need to be running 2.0.17 or you'll get hacked. Secondly, what do you mean by MySQL 3.x files? You reinstalled an older version of MySQL?

Most likely the problem lies in the fact that your old copy of config.php still has the connection info for the old database. Edit the file to reflect your current host, database, username, and password information.
php_user
Registered User
Posts: 138
Joined: Wed Nov 06, 2002 7:23 am
Location: Sweden, Gothenbourg

Post by php_user »

Hello.

what do you mean by MySQL 3.x files? You reinstalled an older version of MySQL?

Old database was create 1 year ago with MySql release v.3. And i try to running this database after i re-install new Apache, MySql rel V4.15.
When i take a look in WinMySqladmin there is username **** and password ****. I shall take a look in config.php and test with usernames and passwords.

Regards
Mathias[/i]
AcousticJames
Registered User
Posts: 970
Joined: Wed Jul 13, 2005 5:59 am
Location: St. Cloud, MN
Contact:

Post by AcousticJames »

php_user wrote: Hello.

what do you mean by MySQL 3.x files? You reinstalled an older version of MySQL?

Old database was create 1 year ago with MySql release v.3. And i try to running this database after i re-install new Apache, MySql rel V4.15.
When i take a look in WinMySqladmin there is username **** and password ****. I shall take a look in config.php and test with usernames and passwords.

Regards
Mathias[/i]


As far as upgrading your MySQL database, you need to go to the MySQL website for support on that.
php_user
Registered User
Posts: 138
Joined: Wed Nov 06, 2002 7:23 am
Location: Sweden, Gothenbourg

Post by php_user »

Here is little testing scrip. I save this mysqlconnect.php and localhost respond this
Could not connect: Access denied for user: 'mysql_user@localhost' (Using password: YES)


mysqconnect.php
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

I reed this in some mysql doc. I dont realy understand what to do.

*`Access denied for user' error*
If you get the error `Access denied for user: 'some-user@unknown'
to database 'mysql'' when accessing a MySQL server on the same
machine, this means that MySQL can't resolve your host name
properly.

To fix this, you should create a file `\windows\hosts' with the
following information:

127.0.0.1 localhost

Regards
Mathias
AcousticJames
Registered User
Posts: 970
Joined: Wed Jul 13, 2005 5:59 am
Location: St. Cloud, MN
Contact:

Post by AcousticJames »

Again, this is a MySQL issue, but the problem is that you're trying to connect via "localhost" which isn't going to work because you're not accessing the database from the same machine it's installed on.

In the MySQL "user" table, you need to set two different username/password records. One for localhost, and one with the hostname of the computer (www.yoursite.com, for example). You need to use the username/password combo for the entry with the hostname, not localhost.

Hope that makes sense, but again, you really should hit the MySQL boards to get MySQL up and running. This isn't a phpBB issue.
php_user
Registered User
Posts: 138
Joined: Wed Nov 06, 2002 7:23 am
Location: Sweden, Gothenbourg

Post by php_user »

Thank you for the support. I think i solve these syntax error. I re-install
all applications (older versions) and now php talkning with mysql in Apache server. But there is still more confusing, now its php related item.

My phpbb forum works 100% now on localhost/apache. But when i always connect internet, php put some messages top of the index page, i dont realy understand. And when i closed internet connection this messages dissaperar. Only show in index.php pages not sub-forums.

Warning: Wrong parameter count for fgets() in c:\program files\apache\htdocs\index.php on line 127

Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache\htdocs\index.php:127) in c:\program files\apache\htdocs\includes\page_header.php on line 651

Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache\htdocs\index.php:127) in c:\program files\apache\htdocs\includes\page_header.php on line 653

Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache\htdocs\index.php:127) in c:\program files\apache\htdocs\includes\page_header.php on line 654


Regards
Mathias
Göteborg
php_user
Registered User
Posts: 138
Joined: Wed Nov 06, 2002 7:23 am
Location: Sweden, Gothenbourg

Post by php_user »

Hello. I find reason for this error. I have installed PJIRC chat mod and after i unistall mod this error disappear.

Regards
Mathias
Locked

Return to “2.0.x Support Forum”