[TYPO3-english] No database selected with correct credential

bernd wilke t3ng at bernd-wilke.net
Fri Apr 5 10:22:34 CEST 2013


Am 05.04.2013 08:33, schrieb Joydeep Bakshi:
> typo3 4.7.10
>
> Please suggest how to fix the issue
>
> Thanks
>
you need to analyse what went wrong.
therefore you might enable all debug/error-output like [1]

the other way: write a small php-test programm to connect:

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
     die('Not connected : ' . mysql_error());
}

// make foo the current db
$db_selected = mysql_select_db('foo', $link);
if (!$db_selected) {
     die ('Can\'t use foo : ' . mysql_error());
}
?>

or step 2:

<?php
include_once('typo3conf/localconf.php')

$link = mysql_connect($typo_db_host , $typo_db_username , 
$typo_db_password );
if (!$link) {
     die('Not connected : ' . mysql_error());
}

// make foo the current db
$db_selected = mysql_select_db($typo_db , $link);
if (!$db_selected) {
     die ('Can\'t use "'.$typo_db .'" : ' . mysql_error());
}
?>


[1] http://pi-phi.de/291.html


bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list