note 72559 added to function.mysqli-connect
| From: | jcwebb at dicoe dot com | Date: | Wed, 24 Jan 2007 14:08:32 +0000 |
| Subject: | note 72559 added to function.mysqli-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122138@lists.php.net to get a copy of this message | ||
PHP520, MYSQL5027, WinServer2003r2
i created a database with no tables
i created a user with no privileges (testuser,testpw,localhost)
<?php
$MYhostname="localhost"; $MYusername="testuser"; $MYpassword="testpw";
$MYdatabase="mysqlitest";
$MYlink=mysqli_connect($MYhostname, $MYusername, $MYpassword, $MYdatabase) or
trigger_error(mysqli_connect_error(),E_USER_ERROR);
printf("Host information: %s\n", mysqli_get_host_info($MYlink));
mysqli_close($MYlink);
?>
This gave an Access Denied error.
But it works with mysql_connect() !!!!!!!!!!!!!
Solution: give the user a GLOBAL SELECT privilege
or create a table and give a SELECT priviledge to the table.
Hope this helps.
----
Server IP: 69.147.83.197
Probable Submitter: 83.52.240.26
----
Manual Page -- http://www.php.net/manual/en/function.mysqli-connect.php
Edit -- https://master.php.net/note/edit/72559
Del: integrated -- https://master.php.net/note/delete/72559/integrated
Del: useless -- https://master.php.net/note/delete/72559/useless
Del: bad code -- https://master.php.net/note/delete/72559/bad+code
Del: spam -- https://master.php.net/note/delete/72559/spam
Del: non-english -- https://master.php.net/note/delete/72559/non-english
Del: in docs -- https://master.php.net/note/delete/72559/in+docs
Del: other reasons-- https://master.php.net/note/delete/72559
Reject -- https://master.php.net/note/reject/72559
Search -- https://master.php.net/manage/user-notes.php