Bug #4615 create table not allowed from php program without password
Submitted: 19 Jul 2004 2:35 Modified: 23 Jul 2004 6:09
Reporter: Richard Williams Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.15 OS:MacOS (Mac OS X)
Assigned to: Matthew Lord CPU Architecture:Any

[19 Jul 2004 2:35] Richard Williams
Description:
User is "inventory" with no password.  I can log in via mysql and create tables and temporary tables ok.

However when I try from PHP with this code:

//+++++++++++++++++++++++
$connection = @mysql_pconnect("localhost", "inventory", "");
mysql_select_db("inventory");
$result - mysql_query("create table inventory.m2 (i INT NOT NULL)") or die (mysql_error() . "<br>");
//+++++++++++++++++++++++

it always gives an access denied error.

As soon as I add a password to the user and change the above to have a password it works fine.  Doesn't seem like this is a PHP error, but maybe it is?

The PHP started failing when I added code for the create table.  It was working find with selects before that.

How to repeat:
User privileges don't matter.  I set user to "all privs" and it still did not work until I added a password to the user.

//+++++++++++++++++++++++
$connection = @mysql_pconnect("localhost", "inventory", "");
mysql_select_db("inventory");
$result - mysql_query("create table inventory.m2 (i INT NOT NULL)") or die (mysql_error() . "<br>");
//+++++++++++++++++++++++
[23 Jul 2004 6:09] Matthew Lord
I could not repeat this using php 4.2.2 on linux nor on php 4.3.2 on OS X 3.4.