Description
This function creates a database.
Warning:
We strongly recommend that you use the following UAPI function instead of this function:
-
Mysql::create_database
— This function creates a MySQL® database.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
db |
string |
Required The database name. |
A valid database name. Warning: The maximum length of the database name is 64 characters. However, due to the method that cPanel & WHM uses to store MySQL database names, each underscore character requires two characters of that limit. Therefore, if you enable database prefixing, the maximum length of the database name is 63 characters, which includes both the database prefix and the underscore character. Each additional underscore requires another two characters of that limit. |
example_database |
Returns
Return |
Type |
Description |
Possible values |
Example |
reason |
string |
A reason for failure. Note: This function only returns a reasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
boolean |
Whether the function succeeded. |
|
1 |