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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: llevier at argosnet dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu May 08 07:01:27 2025 UTC