#36576 [NEW]: Mysql access denied

From: Date: Wed, 01 Mar 2006 17:34:06 +0000
Subject: #36576 [NEW]: Mysql access denied
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-93807@lists.php.net to get a copy of this message
From: jndavs at netscape dot net Operating system: Windows XP PHP version: 5.1.2 PHP Bug Type: MySQL related Bug description: Mysql access denied Description: ------------ Windows XP PHP 5.1.2 Apache 2.0.55 Mysql 5.0.18 I wrote some code using mysquli() to connect to a Mysql database and list the contents of a table: $host = "localhost"; $user = "root"; $pass = "password"; $db = "database"; $mysqli = new mysqli($host, $user, $pass, $db); $query = "SELECT * FROM table"; This worked fine, outputting the expected table data. I added some code to insert data into the table utilising a form: <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> data: <input type="text" name="data"><br /> <input type="submit" name="submit"> </form> $query = "INSERT INTO table (data) VALUES ('$data')"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); This resulted in an error message when the submit button was clicked: "You don't have permission to access /< on this server." So I stripped out the form code, hard coded the data to be inserted in the table and re executed the query: // Data to be inserted into database $data = "dummy"; $query = "INSERT INTO table ( data ) VALUES ('$data')"; // execute query $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); and was rewarded with the following Mysql message: "Access denied for user 'ODBC'@'localhost' (using password: NO)" Any idea what's causing this? -- Edit bug report at http://bugs.php.net/?id=36576&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36576&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36576&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36576&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36576&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36576&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36576&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36576&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36576&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36576&r=support Expected behavior: http://bugs.php.net/fix.php?id=36576&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36576&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36576&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36576&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36576&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36576&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36576&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36576&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36576&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36576&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36576&r=mysqlcfg

« previous php.bugs (#93807) next »