SOLVED Create new mysql Databases command/shell?

kiopeed

Well-Known Member
Jan 11, 2017
67
9
8
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
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
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.
 

kiopeed

Well-Known Member
Jan 11, 2017
67
9
8
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
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
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
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.
 

kiopeed

Well-Known Member
Jan 11, 2017
67
9
8
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:
[[email protected] ~]# 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.
[[email protected] ~]#
I do not know what this error
 

Attachments

Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,203
363
Hello,

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

Thank you.