Description
This function creates a MySQL® database user.
Warning:
- UAPI (recommended) —
Mysql::create_user
— This function creates a MySQL® database user. - cPanel API 2 —
MysqlFE::createdbuser
— This function creates a database user.
Examples
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
username |
string |
Required The MySQL user's name. |
Important: To learn more about database username limits, click the database type to expand the following: MySQL MySQL limits the database username to 16 characters. The system includes the database prefix (the first eight characters of the cPanel account's username and an underscore character) in the character count for the username. For example:
MariaDB MariaDB limits the database username to 47 characters. The system includes the database prefix (all of the cPanel account's username and an underscore character) in the character count for the username. For example:
|
user |
password |
string |
Required The MySQL user's password. |
A secure password. |
12345luggage |
Returns
This function does not return output.