php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9812 Connection to a MySQL DB
Submitted: 2001-03-17 15:46 UTC Modified: 2001-03-17 22:44 UTC
From: llevier at argosnet dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.4pl1 OS: Linux RH 6.2
Private report: No CVE-ID: None
 [2001-03-17 15:46 UTC] llevier at argosnet dot com
mysql_connect("localhost","user","")
report an error that should not exist:
SQL Server error, cannot select databaseAccess denied for user: '@localhost' to database xxx

@localhost ? shouldn't it be user or user@localhost?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-17 15:55 UTC] sniper@php.net
Can you please add a shortest possible script into
this report which can be used to reproduce this?


--Jani

 [2001-03-17 22:44 UTC] sniper@php.net
I can reproduce this one with this script:

<?php

$db=mysql_connect("localhost", "user", "");
$rc=mysql_select_db("thisdbdoesnotexist",$db);
if ($rc<=0) {
echo mysql_error()."\n";
mysql_close($db);
exit;
}

?>

It's mysql_error() in mysql itself that is broken.
I can reproduce this within the mysql shell too..

Not a bug in PHP. -> closed.

--Jani


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC