Project

General

Profile

Actions

Bug #16410

closed

There is no connection to the database!

Added by anthony over 18 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-07-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Warning: mysql_list_tables(): supplied argument is not a valid MySQL-Link resource in D:\sites\typo3\t3lib\class.t3lib_db.php on line 967

I do not get it to work

I have Typ03 files on my Windows XP Professional Workstation with PHP5 and MySQL Server installed on IIS 5.

I just cannot seem to get beyond step 1.

(issue imported from #M3944)

Actions #1

Updated by Dmitry Dulepov over 18 years ago

I do not see it as bug in typo3 because hundreds of people could do it successfully. Looks like it is your local setup problem. May be mysql is not running...

Actions #2

Updated by Michael Stucki over 18 years ago

I agree. I will close this bug but if you can prove that this works in other applications, e.g. phpmyadmin, please reopen it.

Actions #3

Updated by Andreas Balzer over 17 years ago

I have the same problem. phpmyadmin works great but T3 install tool doesn't. If you want I can grant access to a phpinfo

Actions #4

Updated by Kristian Wind about 17 years ago

I think it is the permissions that are wrong. I had the same problem - but when i fixed the permissions it worked.

Actions #5

Updated by Andreas Balzer about 17 years ago

I think I found a little cause for this problem:
if your database information contains an underscore (_) T3 won't connect to the database if you enter these values in install tool.

Workaround: Enter the database information manually into typo3conf/localconf.php and clear cache files (typo3conf/temp*)

Actions #6

Updated by Constantine about 17 years ago

Hi,

I've had the same problem.

I spent lot of time debugging that error before i could find the reason. It was disabled mysql_pconnect function in php.ini
I have disabled it for security reasons, typo3 tries to open persistent database connection per default and ignores warning raised. That can be deactivated in file /typo3_src/t3lib/config_default.php -> change the value of 'no_pconnect' to 1

Regards

Actions #7

Updated by Dmitry Dulepov about 17 years ago

Well, it is generally recommended NOT to use persistent connections. The reason is simple: resource leaks. Data is fetched from database using recordsets. If recordset is not freed explicitely, it stays in the memory until connection is closed. But persistent connections are not closed, they are reused. Thus you have resource leaks all the time.

Recently we started to close all recordsets as soon as we find them in typo3 code. But there are too many queries, so I am pretty sure there are still some hanging recordsets in the system.

I discovered the problem with resources two years ago when apache memory was increasing all the time until system started swapping like mad. I read a lot, experimented and found that simply disabling pconnects eliminates a problem to a large degree.

  • * *
    Constantine, you must not touch t3lib/config_default.php. Do it through Install tool or enable back mysql_pconnect but set another flag in php.ini (search for name!) that makes mysql_pconnect to behave like mysql_connect.
Actions #8

Updated by Stuart McAlpine almost 17 years ago

This exact error is happening during my install too and my SQL settings are:

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

There is no underscore in the database info too, and I have had PHP and MySQL apps running successfully on the same domain/server.

Edit ====
I got around this by setting permissions to 777 to the whole 'typo3conf' directory so maybe it is a permissions error on a different file in there?

I'd already 777'd the 'localconf.php' file.

Actions #9

Updated by David Wehrle over 16 years ago

I agree entirely with Andreas Balzer. The underscore ("_") in my database name was the culprit. The T3 install script did not handle it well. I entered it manually into localconf.php file:

$typo_db = 'db_name';

above the config script write token
where db_name is the name of my database with underscore.

Actions #10

Updated by Chris topher over 14 years ago

This thread has become a collecting basin for quite a number of issues where a connection to the DB cannot be established:
- Some are related to an underscore problem: I cannot reproduce that with current trunk: I can enter a new database name with underscore in the Install Tool and I can choose an existing one with underscore: Tables are created, accessing them works.
- Others are related to the setting for mysql_pconnect.
- Again others to wrong file permissions. Seem to be configuration issues both.

And we did not get any feedback about the original problem (most probably a configuration issue with wrong permissions, too). Therefore I close this issue now.
If you still have connection problems, which you consider being a bug, please check if a bug report describing exactly your issue is already there. If not, report it as a seperate new issue. Thank you!

Actions

Also available in: Atom PDF