The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mysql 5.0 stored procedures

Discussion in 'General Discussion' started by teknowebworks, Nov 28, 2006.

  1. teknowebworks

    teknowebworks Active Member

    Joined:
    Mar 9, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    I have a user that wants to use stored procedures (the main reason to upgrade to 5), anyway i did the upgrade it went well, however when she tried to create a one she get's an access denied.

    PHPmyadmin seems to be in a wierd state, it says the client version is 4.x but sql says it's 5.x. I can't see any permissions in phpmyadmin.

    I tried to do permissions manual

    use db
    grante create procedure * to user blah

    that didn't work, anyone get stored procedures to work from a user account?
     
  2. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    I have the same problems over here, so I bump this thread and ask again: Has anybody a solution for this task?

    Thanks!
     
  3. merm

    merm Member

    Joined:
    Aug 24, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    I'm having exactly the same issue. Haven't found a solution yet.
     
  4. dru383

    dru383 Registered

    Joined:
    Apr 5, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Same problem here too.
     
  5. Franzh

    Franzh Member

    Joined:
    Dec 16, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    The MySQL client is staticly compiled into PHP. Just recompile Apache/PHP afterwards. Also SP requires that you use the mysqli connection.
    Hope this works!
     
  6. teknowebworks

    teknowebworks Active Member

    Joined:
    Mar 9, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Actually, recompliling doesn't seem to help. I solved the problem by running mysql_upgrade as root, to update the system tables from 4 to 5. Seems to have worked, since users can now do sprocs.
     
  7. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    Hi,
    Wondering what was the workaround to restrict the procedures only to the user dbases.

    As far as i know doing:

    grant create procedure * to user blah

    is allowing to the user create and execute the procedure in and dbase in the server.

    Ty!
     
  8. talkrowing

    talkrowing Registered

    Joined:
    Jul 24, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Sorry for digging up an old thread, but this issue is killing me. My host (ukhost4u) seem to be struggling to fix this issue. One minute stored procs were fine and dandy, next minute I can't create edit or execute any. Same error as above eg on execute:

    execute command denied to user 'XXX'@'%' for routine YYY

    Did anyone have a workable solution?
     
  9. teknowebworks

    teknowebworks Active Member

    Joined:
    Mar 9, 2004
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    It sounds like your host recompiled mysql again, check to see if they ran mysql_upgrade
     
  10. talkrowing

    talkrowing Registered

    Joined:
    Jul 24, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the suggestion - Is there a way to check this without asking them? I think they're getting fed up of me!
     
  11. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,281
    Likes Received:
    37
    Trophy Points:
    48
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    I'm also having this problem.

    MySQL 5.0.51
    PHP 5.26
    Apache 1.3.39

    I just recompiled PHP 5 to support mysqli. mysqli is working fine. However, none of my users are able to do the necessary things to allow their sql users that they create to execute a procedure.

    I ran mysql_upgrade (no problems) and then restarted mysql via /scripts/restartsrv_mysql.

    Here is what happens

    root@mach1 [/home/oht/public_html/dev]# /scripts/restartsrv_mysql
    root@mach1 [/home/oht/public_html/dev]# mysql -u oht -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 277
    Server version: 5.0.51a-community MySQL Community Edition (GPL)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> grant execute on procedure oht_database.GNZ to 'oht_sql'@'localhost';
    ERROR 1370 (42000): grant command denied to user 'oht'@'localhost' for routine 'oht_database.GNZ'
    mysql>


    oht is the primary account username
    - access to mysql is given

    oht then tries to run the grant command to grant oht_sql the ability to execute the stored procedure oht_database.GNZ - that's when we get the error.

    Obviously as root I am able to issue the grant and everything works fine. But, if users cannot set up their own mysql users with the ability to create/execute stored procedures, there is no use having this functionality on the server... right?

    Any suggestions folks?

    Mike
     
  12. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Do it from within the cPanel interface.

    Granting privileges requires administrative level privileges and thus is limited to the MySQL root account.
     
Loading...

Share This Page