mysql privilage problem

From: Jorntk (jorntk_at_yahoo.com)
Date: 05/29/04

  • Next message: Peter Wilson: "Frames"
    Date: Sat, 29 May 2004 18:51:36 +0800
    
    

    i created a user with select, insert, update to user on database db

    grant select, insert, update, delete on db.* to user@localhost identified by
    'password';

    the user in not able to drop table but when i try it with my php script
    below it can drop the package_hotel table. Why does the user can drop table
    when it have permission to do so?

    $host='locahost';
    $username='user';
    $password='password';

    function db_connect()
    {
       $result = mysql_pconnect($host, $username, $password);
       if (!$result)
          return false;
       if (!mysql_select_db('db'))
          return false;

       return $result;
    }

    $conn = db_connect();
    if (!$conn)
        return 'Could not connect to database server - please try later.';

     $result = mysql_query("drop table package_hotel");
     if (!$result)
         print 'cannot select from package';

    --
    Thanks and Regards
    Jorn
    

  • Next message: Peter Wilson: "Frames"

    Relevant Pages

    • Re: T-SQL Debugger Error
      ... denied on object 'sp_sdidebug', database 'master', owner 'dbo'. ... and when I grant the permission of sp_sdidebug, ... I am using following statement to grant the permission. ...
      (comp.databases.ms-sqlserver)
    • RE: Security context of stored procedure
      ... Suppose there are three users in a database TEST_CHAIN, ... simple stored procedure: ... also grant it to test_sp2 ... SELECT permission denied on object 'authors', database 'test_chain', owner ...
      (microsoft.public.sqlserver.security)
    • Re: GRANT BACKUP DATABASE
      ... I grant to one user the permission to backup one database but now i cant ...
      (microsoft.public.sqlserver.server)
    • Re: SQL2005 grant user access to certain tables
      ... Then for each table that the user needs to read, give SELECT permission to ... Most good judgment comes from experience. ... We have a database on SQL2005 with 50 tables. ... We want to grant someone read table rights to only some tables. ...
      (microsoft.public.sqlserver.security)
    • Re: Security context of stored procedure
      ... It seems that cross database tables are completely blocked from stored ... > grant exec ... > simple stored procedure: ... SQL Server will not check the permission of the ...
      (microsoft.public.sqlserver.security)