Project

General

Profile

Actions

Bug #29245

closed

Message: "Can only select database if username/password/host is correctly set first." is misleading

Added by Kestutis no-lastname-given about 13 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2011-08-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hello,

When I upgrade 4.3 to 4.4.10 I get this error:
"Can only select database if username/password/host is correctly set first."

All database settings are correct, I tried to set them manually in localconf.php, but this also did not make it work.

===

Added by Christopher:
The problem was caused by $TYPO3_CONF_VARS['SYS']['no_pconnect'] = 0, not by wrong credentials.
So the error message is incomplete and for this case just wrong.
We should add a hint to the message to check $TYPO3_CONF_VARS['SYS']['no_pconnect'].

Actions #1

Updated by Kestutis no-lastname-given about 13 years ago

should be "When trying to upgrade 4.3 to 4.4.10"...

Actions #2

Updated by Chris topher about 13 years ago

  • Subject changed from TYPO3 4.4.10 install tool (Can only select database if username/password/his correctly set first) to Install Tool: "Can only select database if username/password/host is correctly set first."
  • Category set to Install Tool
  • Status changed from New to Needs Feedback

Did TYPO3 4.3 work correctly before?

If the database credentials are correct, did you change something else (besides upgrading TYPO3 itself)? E.g. something with MySQL? Move to a new server? New MySQL-Version?

Actions #3

Updated by Kestutis no-lastname-given about 13 years ago

Yes, 4.3 did work correctly.
I didn't change anything. I know database settings in localconf.php, they are correct,
but something just stuck. MYSQL version is the same. Maybe minimize localconf.php just to basic extensions and configurations and test?

Actions #4

Updated by Chris topher about 13 years ago

Reducing localconf.php to only the 3 lines with the database credentials $typo_db_username, $typo_db_password, $typo_db_host will break almost everything in your installation, but only for checking the DB access in the Install Tool it should be enough.

Do you use dbal? This might influence behaviour here.

Actions #5

Updated by Kestutis no-lastname-given about 13 years ago

I tried it without dbal, tried with empty localconf, having only database settings. The same.
I have noticed similar problems in http://forge.typo3.org/issues/21632
but it seems no consensus was reached about this problem.

Actions #6

Updated by Chris topher about 13 years ago

This might be a problem with persistent connections in MySQL.

Edit the file t3lib/class.t3lib_db.php: In the function sql_pconnect(), directly below the line $error_msg = $php_errormsg; add this:
echo $this->link;
echo $error_msg;
die();

I guess that $this->link is empty. $error_msg will contain the according error message.

Try setting $TYPO3_CONF_VARS['SYS']['no_pconnect'] = 1 in the Install Tool.

Actions #7

Updated by Kestutis no-lastname-given about 13 years ago

Thank you. Got this error:
mysql_pconnect() has been disabled for security reasons

So it's a hoster's problem..?

Actions #8

Updated by Kestutis no-lastname-given about 13 years ago

Maybe it would be worth to add some error report about not working mysql_pconnect() to Install tool?
I remember I had exactly the same problem with former hosters.

Actions #9

Updated by Kestutis no-lastname-given about 13 years ago

With

$TYPO3_CONF_VARS['SYS']['no_pconnect'] = 1

it worked. Thanks!

Actions #10

Updated by Chris topher about 13 years ago

A hint to check $TYPO3_CONF_VARS['SYS']['no_pconnect'] would have helped you.

The text of the error message is incomplete and in so far wrong.

To fix it we could add to the error message, that this error could also be caused by "persistent connections" in MySQL being forbidden and that this is fixable with setting $TYPO3_CONF_VARS['SYS']['no_pconnect'] = 1.

What do you think?

Actions #11

Updated by Kestutis no-lastname-given about 13 years ago

We could add to the error message, that this error could be caused by "persistent connections" in MySQL being forbidden >and that this is fixable with setting $TYPO3_CONF_VARS['SYS']['no_pconnect'] = 1.

I think it would be great, since I noticed I was not the only one, and while looking for solution, found quite many similar questions in forums. Without error report one just searching for many various possible things. Simple error report would minimize possible confusion and would narrow possible search + save time.

I'm not sure if it would fit into current Install tool concept, but I think simple base system (server+database) configuration check and reporting (it could be visual or just a simple log) could help in determining possible roadblocks for the average user.

Thank you very much for the help.

Actions #12

Updated by Chris topher about 13 years ago

  • Subject changed from Install Tool: "Can only select database if username/password/host is correctly set first." to Message: "Can only select database if username/password/host is correctly set first." is misleading
Actions #13

Updated by Chris topher about 13 years ago

  • File deleted (phpconfigure.txt)
Actions #14

Updated by Mr. Hudson about 13 years ago

Patch set 1 of change I28f373c1e771f00d1584eff5080bfa51cf48ed96 has been pushed to the review server.
It is available at http://review.typo3.org/4633

Actions #15

Updated by Chris topher about 13 years ago

  • Status changed from Needs Feedback to Under Review
Actions #16

Updated by Mr. Hudson about 13 years ago

Patch set 2 of change I28f373c1e771f00d1584eff5080bfa51cf48ed96 has been pushed to the review server.
It is available at http://review.typo3.org/4633

Actions #17

Updated by Mr. Hudson about 13 years ago

Patch set 3 of change I28f373c1e771f00d1584eff5080bfa51cf48ed96 has been pushed to the review server.
It is available at http://review.typo3.org/4633

Actions #18

Updated by Chris topher about 13 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #19

Updated by Chris topher about 13 years ago

  • Target version set to 1341
Actions #20

Updated by Ernesto Baschny over 11 years ago

  • Target version deleted (1341)
Actions #21

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF