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.

createdb not auto-prefixing after update

Discussion in 'General Discussion' started by mainescott, Oct 14, 2015.

  1. mainescott

    mainescott Registered

    Joined:
    Oct 14, 2015
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Maine, USA
    cPanel Access Level:
    Website Owner
    My host updated CPanel this morning, supposedly from 11.50.2.2 to 11.52.0.14. I have been using the api2 API for some time to auto-provision databases and users and this morning after the update those calls started failing with an error that the specified database name does not start with the appropriate prefix. Which is true, but in the past I never had to specify the prefix, it was just added automatically by CPanel.

    I can obviously change my code to add the prefix to the database name, but it just seems odd to me that the behavior changed. I looked through the 11.52 change log and I didn't see any topics that looked like they obviously applied to this situation, so I'm concerned that I'll modify my code and later the behavior will change again and I'll start getting double-prefixed database names or something.

    Does anyone have any insight on whether I should have expected this change or if there's something else I should take a look at before I modify my code?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,830
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I suggest updating your script to utilize UAPI instead of cPanel API2:

    UAPI Functions - Mysql::create_database - Software Development Kit - cPanel Documentation
    UAPI Functions - Mysql::create_user - Software Development Kit - cPanel Documentation

    Per the documentation for these functions:

    That being said, should you continue to use cPanel API2, no additional changes are expected because if the desired function is available, users are recommend to use our newer UAPI functions.

    Thank you.
     
  3. chiefme

    chiefme Member

    Joined:
    Jan 21, 2009
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Faced with identical situation, so I completely agree with mainescott and I have to contribute to its question.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,830
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    This question is answered in my earlier response. Per the document:

    Thank you.
     
Loading...

Share This Page