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.

SOLVED Create new mysql Databases command/shell?

Discussion in 'Database Discussions' started by kiopeed, Jan 11, 2017.

Tags:
  1. kiopeed

    kiopeed Member

    Joined:
    Jan 11, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    cairo
    cPanel Access Level:
    Root Administrator
    how creat new msql Databases command/shell
     
    #1 kiopeed, Jan 11, 2017
    Last edited by a moderator: Jan 11, 2017
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. kiopeed

    kiopeed Member

    Joined:
    Jan 11, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    cairo
    cPanel Access Level:
    Root Administrator
    welcome mr.cPanelMichael
    I do not know to use this site in my order
    UAPI Functions - Mysql::create_database - Software Development Kit - cPanel Documentation
    Please I want to know simply orders
    I need a job
    Example prefer pictures
    1-
    codex.wordpress.org/images/a/ae/cpanel-createdb-step1.png
    2-
    codex.wordpress.org/images/2/24/cpanel-createdb-step2.png
    3-

    codex.wordpress.org/images/5/5b/cpanel-createdb-step3.png


    Please I want the work of this command line Please

    I want it here, please, for example,
    Code:
    /scripts/pkgacct username
    Thank You mr. cPanelMichael
     
    #3 kiopeed, Jan 11, 2017
    Last edited by a moderator: Jan 12, 2017
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you elaborate a little more on which part of the document you'd like help with? For instance, you can browse to:

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

    Then, look under "Examples" and expand "Command Line" to see an example of how to run it as a command. You can also create database users and add database users to databases:

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

    Thank you.
     
  5. kiopeed

    kiopeed Member

    Joined:
    Jan 11, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    cairo
    cPanel Access Level:
    Root Administrator
    I apologize mr cPanelMichael
    I do not understand
    What can I type here command
    uapi --user=username Mysql create_database name=newdb
    uapi --user=username Mysql create_user name=dbuser password=12345luggage
    uapi --user=username Mysql set_privileges_on_database user=dbuser database=mydb privileges=DELETE,UPDATE,CREATE,ALTER


    ؟؟
    How can type here at command
    Is there an example of, for example,
    Sorry for the inconvenience please help me
    I want, for example, I set up a database named (avengers)
    and i have domin Name example.com
    I have created this free domain experience
    How can I create the database as I mentioned to you that name is also mentioned in the previous

    I want you to, for example, an example
    uapi --avengers=avengers Mysql create_database avengers=newdb
    I want you to correct code
     
    #5 kiopeed, Jan 14, 2017
    Last edited by a moderator: Jan 14, 2017
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @kiopeed,

    Let's say the cPanel account username is 'cpuser123', and you want to create a database named 'avengers' under this cPanel account. In this case, you'd access SSH as root and enter the following command:

    Code:
    uapi --user=cpuser123 Mysql create_database name=avengers
    Next, you'd run the following command to create the MySQL user:

    Code:
    uapi --user=cpuser123 Mysql create_user name=dbuser password=12345luggage
    Simply replace 'dbuser' and '12345luggage' in the above command with the database username and password of your preference.

    Finally, add the user to the database with this command:

    Code:
    uapi --user=cpuser123 Mysql set_privileges_on_database user=dbuser database=avengers privileges=ALL%20PRIVILEGES
    Replace "ALL%20PRIVILEGES" with the the specific privileges that match your preference, as documented at:

    UAPI Functions - Mysql::set_privileges_on_database - Software Development Kit - cPanel Documentation

    Information on accessing your server via SSH is available at:

    SSH Access - Documentation - cPanel Documentation

    Let us know if this helps.

    Thank you.
     
  7. kiopeed

    kiopeed Member

    Joined:
    Jan 11, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    cairo
    cPanel Access Level:
    Root Administrator
    Li shows an error
    Hosting data is
    user is :avengers
    Through it :
    Code:
    uapi --user=avengers Mysql create_database name=avengers
    PHP:
    [root@host ~]# uapi --user=avengers Mysql create_database name=avengers
    Failed to close read filehandle from “/usr/local/cpanel/cpanel”:  at /usr/local/cpanel/Cpanel/XML.pm line 97.
    /usr/local/cpanel/cpanel” exited with status 1 (EPERM). at bin/apitool.pl line 147.
    [root@host ~]#
    I do not know what this error
     

    Attached Files:

    #7 kiopeed, Jan 17, 2017
    Last edited by a moderator: Jan 17, 2017
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  9. kiopeed

    kiopeed Member

    Joined:
    Jan 11, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    cairo
    cPanel Access Level:
    Root Administrator
    #9 kiopeed, Jan 24, 2017
    Last edited: Jan 24, 2017
  10. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  11. kiopeed

    kiopeed Member

    Joined:
    Jan 11, 2017
    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    cairo
    cPanel Access Level:
    Root Administrator
    i done open at
     
  12. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    36,995
    Likes Received:
    1,275
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, it looks like the commands are now working well after addressing an issue with the license on the system.

    Thank you.
     
Loading...

Share This Page