Recent Topics

1 Nov 02, 2006 22:16    

Hi,

I just tried to upgrade from 0.9.1 to 1.8.2.

0.9.1 was running just fine for a long time now.

After calling blogs/install and providing all necessary data
I only got

MySQL error!

Error establishing a database connection!

()

1. Are you sure you have typed the correct user/password?
2. Are you sure that you have typed the correct hostname?
3. Are you sure that the database server is running?

I double checked all data, it is correct.

My web hoster runs MySQL 4.0.24 / php 4.1.2 on Solaris 8.

Any ideas?

Thanks, Sven
www.typ15.de

2 Nov 03, 2006 00:30

looks like you've got it sorted :)

3 Nov 03, 2006 00:51

Sylv, he's running 0.9.1 on www.typ15.de.

Sven, there should be the output from mysql_error() in the empty part between the brackets of your error message. It's strange, because it's empty.

Can you go into /inc/_misc/_db.class.php and put a


var_dump( $this->dbhandle );


before the line that says "if( ! $this->dbhandle )" (around line 300 probably).
What does it say?

4 Nov 03, 2006 00:55

oops sorry, he reverted.

5 Nov 03, 2006 01:03

Or tests it, before doing it "live".. ;)

6 Nov 03, 2006 07:06

blueyed wrote:

What does it say?

Oh, it only says

NULL

8|

Sven

7 Nov 03, 2006 15:50

The doc for mysql_connect says:
"""
Returns a MySQL link identifier on success, or FALSE on failure.
"""

So, NULL is strange.

Try two thing:
1. Remove the "@" in front of the mysql_connect() (line 300) - probably it will throw a warning then. Make sure you have "display_errors=1" and "error_reporting=E_ALL" for your PHP (see http://manual.b2evolution.net/Debugging).
2. Make sure the "function DB" part looks like here: http://evocms.cvs.sourceforge.net/evocms/b2evolution/blogs/inc/_misc/_db.class.php?view=markup&pathrev=v-1-8 - maybe you have edited something etc?!

If this still does not help to show the error, try tracking it down, by inserting e.g. "var_dump($params['handle']);" to see if there gets a handle param passed etc.

8 Nov 03, 2006 16:29

blueyed wrote:

1. Remove the "@" in front of the mysql_connect() (line 300) - probably it will throw a warning then.

After removing the "@", I now get

Warning: Wrong parameter count for mysql_connect() in
/mnt/jd1/04/408/00000014/htdocs/blogs.new/inc/_misc/_db.class.php on line 288

I did not modify the 1.8.2 code in any way.

Sven

9 Nov 03, 2006 18:21

the client_flags parameter has been added in PHP 4.3.0 and the new_link parameter in 4.2.0.

b2evo requires PHP 4.3 - also at other places.

You can replace the line with the mysql_connect with this block:


			if( version_compare(PHP_VERSION, '4.3', '>=') )
			{
				$this->dbhandle = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
			}
			elseif(version_compare(PHP_VERSION, '4.2', '>=') )
			{ // PHP 4.2: client_flags not available
				$this->dbhandle = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link );
			}
			else
			{ // PHP before 4.2: new_link and client_flags not available
				$this->dbhandle = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword );
			}

10 Nov 03, 2006 19:18

Oh, thanks a lot -- so I will better upgrade to php 4.3 if I can convince my
web hoster to do so :-/

Next time I will consider reading the release notes before asking ;-)

Sven


Form is loading...