Bug #29245
closedMessage: "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.
100%
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'].
Updated by Kestutis no-lastname-given about 13 years ago
should be "When trying to upgrade 4.3 to 4.4.10"...
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?
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?
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.
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.
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.
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..?
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.
Updated by Kestutis no-lastname-given about 13 years ago
With
$TYPO3_CONF_VARS['SYS']['no_pconnect'] = 1
it worked. Thanks!
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?
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.
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
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
Updated by Chris topher about 13 years ago
- Status changed from Needs Feedback to Under Review
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
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
Updated by Chris topher about 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9916fcedc3f6fbd2dd73fe676d4b8faaff825734.